Android中如何在布局文件中为组件绑定点击事件?
阿神
阿神 2017-04-17 17:38:21
0
1
500

Android中如何在布局文件中为组件绑定点击事件?

阿神
阿神

闭关修行中......

reply all(1)
伊谢尔伦

Add the onClick="name" attribute to the component in the layout file.
The "name" can be arbitrary, as long as it corresponds to the class

Then in the class
public void name(View view) {

System.out.println("我被点击了!");

}

Write your click logic in this function

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template