re-open background application via notification item

前端 未结 6 1697
生来不讨喜
生来不讨喜 2020-12-10 07:14

I got an app with tabs and a notification bar entry, when I send it to background (click on home button) and try to re-open the application via click on the notification ba

6条回答
  •  粉色の甜心
    2020-12-10 07:58

    Are you implementing the onSaveInstanceState methods as recommended in the lifecycle documentation?

    Its possible that when you pause an application and go back to it immediately, that the application is still hanging out in memory in the background. However, you can't depend on this, so you should save state like the currently open tab everytime you go into the background, and restore it when you get reactivated.

提交回复
热议问题