开发者

Android - Refresh/restart a previous activity

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜