0

So, the idea is: user launching application, and I have to perform task X.

User work some time and then quit (app is in background now).

Then he open app again (from background) and I have to perform task X again.

In first case, I can simply use onCreate() of custom Application class, but it is not that simple with the second one - there's no onResume() method or something. Any ideas?

uncle Lem
  • 4,954
  • 8
  • 33
  • 53
  • Use onCreate, onResume, onPause etc. of your Activity derivative classes instead – tiguchi Aug 12 '13 at 21:14
  • @NobuGames but `onResume` and `onPause` also executing when we move to/from another activity, and it's not my case. – uncle Lem Aug 12 '13 at 21:38
  • 1
    Maybe the following question is of help: http://stackoverflow.com/questions/4414171/how-to-detect-when-an-android-app-goes-to-the-background-and-come-back-to-the-fo – tiguchi Aug 12 '13 at 21:57

1 Answers1

0

Accroding to activity lifecycle every time activity is no more shown to user the same method is called, no matter if it went background by pressing "Home", or was overlayed by another activity.

Maxim Efimov
  • 2,747
  • 1
  • 19
  • 25