开发者

Android: How to set onTouch event for activity?

开发者 https://www.devze.com 2023-04-02 05:16 出处:网络
I have an activity I wan开发者_StackOverflow社区t to finish when the activity is touched, how do I go about doing this?Get a reference to the top level View in your layout and call .setOnTouchListener

I have an activity I wan开发者_StackOverflow社区t to finish when the activity is touched, how do I go about doing this?


Get a reference to the top level View in your layout and call .setOnTouchListener() on it passing an OnTouchListener with finish(); in the onTouch() method.

0

精彩评论

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