Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect user interaction in Android

I have a timer in my application and want to reset it on user interaction.

I tried adding onTouchListener but it blocks my onClickListener.

like image 762
isha Avatar asked Dec 03 '22 16:12

isha


1 Answers

See this link How to detect USER INACTIVITY in android

There is method available in android activity called onUserInteraction with the help of onUserInteraction method we can find the user-interaction with particular activity

@Override
public void onUserInteraction()
{
    MyTimerClass.getInstance().resetTimer();
}
like image 169
isha Avatar answered Dec 05 '22 04:12

isha