I want to make a method (service, alarm , etc) that can calculate after x time of inactivity of the user with the app
, which closes the current activity
and send you to the initial activity (login)
Thank you very much
I want to make a method (service, alarm , etc) that can calculate after x time of inactivity of the user with the app
, which closes the current activity
and send you to the initial activity (login)
Thank you very much
You can use the CountDownTimer class, here is an example of how to use it
In the onFinish method you would have to execute the action of starting another activity.
Once you have the time, in nanoseconds, you store it in time and execute the following code, the Handler is, so to speak, the concurrent thread manager that will send a message to the APP (mainThread) to be executed your code written in the method run().