Android - restore last viewed Activity

后端 未结 3 1491
深忆病人
深忆病人 2020-12-09 20:40

I have 3 different Activities that user navigates between in no particular order. My goal it twofold:

  1. When user switches to something else when app is resumed
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-09 20:56

    Keep in mind that onSaveInstanceState() isn't workable for long-term state, i.e. the user powers the phone down and then turns it back on at an indeterminate point later. You will need to create your own long-term state mechanism if you wish for your state to survive power cycles.

提交回复
热议问题