开发者

restoring the task to it's last state in android

开发者 https://www.devze.com 2023-01-29 06:31 出处:网络
I\'m not talking about restoring application state (using Bundle or configuration change or even SharedPreferences) i\'m talking about the fact that i have a certain task, that is a base activity: Hom

I'm not talking about restoring application state (using Bundle or configuration change or even SharedPreferences) i'm talking about the fact that i have a certain task, that is a base activity: HomeScreenActivity and from there i can have a series of activities opened for the user's flow. I want in case of application's death or user killed his own session to restore the whole task, not just one activity, i mean to restore the whole activity stack i had before the application was killed. if the user was in my billing screen and left off my app i want to take him back to that screen, but i want that if he'll press back he'll go back to my search screen or filtering screen, whatever was there before he left off.

I have no problem开发者_如何学Go saving the activity's order in sharedPreferences and know the order once i start my home screen, but i wonder if there's a way to tel landroid to start an activity, which sould only enter the task's stack and not call the activity's onCreate method unless i actually get to it(with back key).


Perhaps someone will have a better idea, but the only thing that comes immediately to mind is to add a "resetup" flag so that you could sort of replay a script of the user's previous activity navigation actions within your app, having your activities start each other up in turn but due to the resetup flag bypassing most of their code so they don't really do anything except essential setup and start the next one.

One complication is that it's probably the activity they were actually in which android will resume.

0

精彩评论

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