简体   繁体   English

Android超时监听器

[英]Android Time-out Listener

how can i make my application in android feels that there are no events , i need the application (on any activity) to show a pop-up to the user asking "are you still there or shall i shut down !!! " 我该如何使我的应用程序在android中感觉没有事件,我需要该应用程序(在任何活动中)向用户显示弹出式窗口,询问“您是否仍在那儿或我应该关闭!”

i have many activities and massive number of listeners, so making this per each 我有很多活动和大量的听众,因此每个

onTouchListener()

is exhausting 筋疲力尽

isn't there any other way than overriding the 除了覆盖

onTouch() 

for every activity and setting it in every 进行每项活动并将其设置在每项活动中

setOnTouchListener() 

for every view ? 对于每个视图?

You can create a base activity for you app and override onUserInteraction() method. 您可以为您的应用创建基本活动,并覆盖onUserInteraction()方法。 Also take a look at onUserLeaveHint() 还看看onUserLeaveHint()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM