Search code examples
androidonresumeonpause

Do action if app paused for more than 5 minutes


I have an android app and I would like to be able to set it that if the app is minimized for less that 5 minutes it will resume normally but if for over 5 minutes will will be restarted like a banking app works.

I can't find anything on this can be achieved, can someone provide some pointers on where I should look to get this functionality.

Thanks.


Solution

  • I think it's easier just to save a timestamp when your app is paused and check it on resume