Here is the scenario:
I have two Activities. Lets name them Activity A and Activity B.
Say Activity A is open. Now, when I go and open Activity B, Activity A is closed because the onStop() method is called.
Now, when I flip back to Activity A, the onCreate() method is called, but I want the onRestart() method called instead. How do I do this?
You cannot influence the livecycle of your app like that. There should be no reason to rely on
onRestart(). If you useonStart()it will always be called no matter if the Android OS killed the app process in the background.Check out this doc for further information:
http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle