开发者

Android - Refresh/restart a previous activity

开发者 https://www.devze.com 2023-02-04 17:22 出处:网络
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 s

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

精彩评论

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

关注公众号