开发者

Pressed Listener for a View

开发者 https://www.devze.com 2022-12-29 07:56 出处:网络
In android, is there such 开发者_JAVA百科a thing for listening if a View is pressed? In background drawable, i can set assert depends on the view is pressed or not.

In android, is there such 开发者_JAVA百科a thing for listening if a View is pressed? In background drawable, i can set assert depends on the view is pressed or not.

Is it possible for me to add a Listener for a View when I pressed it?

Thank you.


You can set and OnClickListener to any View, which is the base class for just about everything in Android!


This is what the Button class is for. It doesn't have to "look" like a button to be one.

0

精彩评论

暂无评论...
验证码 换一张
取 消