I want my app do an automatic full logout if it doesn’t use a minute.

How can I do it?

  • Does it make sense? Just write to the log interesting events. What events do you want to display in the log? - iamtihonov
  • It seems to me that this can be done through programming. - Nick Volynkin

1 answer 1

It is very simple. You can override the onPause method in activit and write a service start with a timer in it. Also redefine onStart on the rest of the service. If the minute has passed and the service is not stopped, then you need to send a message through the receiver and make a logout. If something is not clear, ask. Pro receiver Pro service

  • Can you please write a sample code with a timer? onPause method: protected void onPause () {super.onPause (); AppLogic.hideProgressBar (); - Testing Man
  • And what exactly is not clear? The timer in the service is just AsyncTask with Thread.sleep for a minute. - Kota1921