1

I have an activity that starts another then if the user cancels from the second I call finish() and return to the first.

Question: Is there a method that gets called when I get returned to the first activity?

Thanks for any help

3 Answers 3

3

Yes, onResume() is called. Check the :Activity Lifecycle

See the lifecycle:

Activity Lifecycle

2
  • That might not always be true, for instance dialog may pause and resume, but not stop and start them,since they may noy cover all the screen, anyway it depends on your need Feb 6, 2013 at 19:09
  • 1
    OnResume is always called. Feb 6, 2013 at 19:22
1

Yes there is onStop() and onStart(), for more details see:

http://developer.android.com/reference/android/app/Activity.html

img

0

The original application will receive whatever callbacks are on the activity life cycle flowchart that are between the application's current state and "Activity Shut Down" state. onDestroy() is the only one guaranteed to happen.

If the finished application was on the top of the stack then the Activity that replaces it on the top of the stack will receive at least onResume(). If it was completely invisible (i.e. it had received onStop(), then it will also receive onRestart() and onStart() before onResume().

If the finished Application was not on top of the stack then no other Application is notified.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.