views:

19

answers:

0

If I launch an activity from my ListView, when I go back to the ListView it is reset back to the beginning - the original position within the ListView is lost.

This does not happen if I change the orientation of the device. onRestoreInstanceState is called and the position within the ListView is maintained.

  1. What is causing the position in my ListView to be reset when it is covered by an activity? Note that onDestroy is not being called, just onPause(), onStop(), onStart() and onResume(). The position is OK after onStop() and is already reset when onStart() is called.

  2. If I have to manage this myself what's the best method? I can save off the position with getFirstVisiblePosition() and restore it with setSelection(). But I'd really like the position to be stored in the instance state. Any suggestions here?

Regards

Phil