0

In the Android app, I have navigated as A->B->C->D
When creating activity A, I store some values in static variables (as some form of in memory cache.)
Then when moving to D, I use those values.

When leaving the phone minimised for quite some time, the in memory variable gets cleaned up which is expected
But when app is opened again, D gets recreated but I now don't have access to those in memory variables
In this case, I want that app should restart from activity A.

Any help on how can I achieve that.
Also in my app there are various modules, and I want that this should happen only for one specific module

  • If you pass the values through intent they will survive process death! – Malik Bilal Feb 17 '23 at 14:48
  • @MalikBilal This is not even the usecase. In activity A, after some API call data is saved in static data holder. It's like a session cache. I just want that when data is cleared from data holder, activity stack should also get cleared – Ujjwal Kumar Maharana Feb 18 '23 at 04:58

0 Answers0