I need to have two activities in an Android app that can be switched between each other with UI persistence as follows:
Activity A launches Activity B.
User triggers some UI changes in Activity B.
Activity B returns to Activity A (by a call to
onBackPressed()
or something similar)Activity A re-launches Activity B.
I would like the changes made in step 2 to be visible in step 4.
I have tried using the singleInstance
activity tag on Activity B to no avail. I would also prefer a more elegant solution than simply writing all object properties to a file or SQLite table.
It seems that this behaviour must be easily achievable given that Android does it automatically for calls to onBackPressed()
where the parent Activity's UI is saved.
Any help is much appreciated.