Android Activities UI Persistence
        Posted  
        
            by aandroid
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by aandroid
        
        
        
        Published on 2010-06-10T23:57:35Z
        Indexed on 
            2010/06/11
            0:02 UTC
        
        
        Read the original article
        Hit count: 393
        
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.
© Stack Overflow or respective owner