开发者

Android: Growing backstack problem, how to conserve memory?

开发者 https://www.devze.com 2023-04-07 08:53 出处:网络
our app is designed using fragments and fragment transactions in a way where the user can keep going forward and \"grow\" our backstack indefinately.Now, besides the \"dont design the app that way\" a

our app is designed using fragments and fragment transactions in a way where the user can keep going forward and "grow" our backstack indefinately. Now, besides the "dont design the app that way" answer, what options do I have to conserve memory. Eventually we run out and crash. Is there a way to onSaveInstanceState, save most of the state, release all the views (which hopefully releases memory associated with them), and then reload the views? Or is there a way to remove some transactions from the bottom of the stack? We are ok with loosing some of the user's开发者_开发百科 backstack history if it comes from the bottom of the stack. Meaning: we would only keep the last 5 transactions in memory or something like that.

0

精彩评论

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