Restart App when in memory variable values are cleared

35 Views Asked by At

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

0

There are 0 best solutions below