I develop android app and have memory management problems. I have ability to navigate through infinite way like:
User activity that contains followers of user (U) -> Another user (U) -> post (P) -> U -> U -> P -> ... etc
So, basically I'd made it just through starting new activity, but i had noticed when I open about 6-7 activities it crashes with memory error. Each activity starting to eat more and more memory. First of all - finish() previous activity before start new one is not good, because i need to let user get all way back. Second, I'd tried to fix it with
FLAG_ACTIVITY_REORDER_TO_FRONT
to use already initiated activity, instead starting new one. But it not redrawing it on first use. For example when i restore post activity when it comes first time it comes with previous post, but when i go back and opening it again all working good. But still no luck.
What the best way to organize this kind of infinite stack? It's able to make stack store for example 5-6 previous steps and close very deep activities. For example- is it able to store full activity state to some storage and organize activity stack manually?
Regards