How exactly does the android:onClick XML attribute differ from setOnClickListener?

后端 未结 17 2144
野趣味
野趣味 2020-11-21 11:50

From that I\'ve read you can assign a onClick handler to a button in two ways.

Using the android:onClick XML attribute where you just use t

17条回答
  •  醉酒成梦
    2020-11-21 12:01

    Suppose, You want to add click event like this main.xml

    In java file, you have to write a method like this method.

    public void register(View view) {
    }
    

提交回复
热议问题