user576820
user576820

Reputation: 1347

Android - Refresh/restart a previous activity

When a user returns from an activity to the main menu of my program, what class do you use to for example; refresh/restart the main menu (update it)?

Upvotes: 1

Views: 2127

Answers (1)

Cristian
Cristian

Reputation: 200080

It depends... if you started the second activity and want to update the first, you should:

  • Use startActivityForResult method to start the second activity
  • Place the "refresh code" in the onActivityResult method of your first activity.

If that's not the scenario, you can try to place the refresh code in onResume.

Upvotes: 2

Related Questions