Is onResume() called after intent finished?

Is the method in MainActivity called after intent (which was called from MainActivity) is finished?

By intent was finished I mean: MainActivity creates intent to open another activity, and when you are done in that activity you go back to MainActivity, is the onResume method called?

Upvotes: 2

Views: 2664

Answers (2)

Rakshith Ravi
Rakshith Ravi

Reputation: 385

onResume() is triggered when the app loses focus, and then gains focus back again.

So yes, the answer to your question is yes.

Upvotes: 2

Justin Jasmann
Justin Jasmann

Reputation: 2353

For others, the full process (in this case) would be:

1. MainActivity.onCreate()
2. MainActivity.onStart()
3. MainActivity.onResume()
4. startActivity(new Intent(this, SecondActivity.class))
5. MainActivity.onPause()    // when partially obstructed
6. SecondActivity.onCreate()
7. SecondActivity.onStart()
8. SecondActivity.onResume()
9. MainActivity.onStop()     // when fully obstructed

Upvotes: 6

Related Questions