android - when does not touch for a while activity? -
i have screen , if user goes there , nothing, screen should close after 15 seconds, if user starts input wait time must increase before screen closed.
private static long v_time = 1000 * 15; handler handlerui = new handler(); . . . handlerui.postdelayed(new runnable() { @override public void run() { finish(); } }, v_time);
this code of mine closes screen after 15 seconds though user may still trying input something. suggestions ?
first of 15 seconds short time span! consider confirmation message user can still resume if desired.
you can use onuserinteraction():void method activity reset timer on every user interaction detected.
from api
onuserinteraction() called whenever key, touch, or trackball event dispatched activity.
Comments
Post a Comment