When a user return开发者_如何转开发s 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)?
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
.
精彩评论