Android: How to restore List data when pressing the "back" button?

Posted by Rob on Stack Overflow See other posts from Stack Overflow or by Rob
Published on 2010-03-15T13:52:12Z Indexed on 2010/03/15 15:09 UTC
Read the original article Hit count: 357

Filed under:
|
|

Hi there,

My question is about restoring complex activity related data when coming back to the activity using the "back" button". Activity A has a ListView which is connected to ArrayAdapter serving as its data source - this happens in onCreate().

  1. By default, if I move to activity B and press "back" to get back to activity A, does my list stay intact with all the data or do I just get visual "copy" of the screen but the data is lost?
  2. What can I do when more than activities are involved? Let's say activity A starts activity B which starts activity C and then I press "back" twice to get to A. How do I ensure the integrity of the A's data when it gets back to the foreground? PrefsManager does not seem to handle complex object very intuitively.

Thanks, Rob

© Stack Overflow or respective owner

Related posts about android

Related posts about activity