Reputation: 645
I am having a TabHost. One of the tabsconains ListActivity. When it is loaded - user can search and items are populated in the list.
When user clicks on a ListViewItem a new Intent of a new TabHost is being created. When user presses the BACK button, he gets back to the TabHost on the ListActivity (from where the new Inetnt was started)
The problem is that now the listview is empty.................
How can I maintain it? (I have 2 different listviews that it happens from - 1 is searcing on the local DB and haveing CursorAdapter (so have to maintain the cursor as well). The 2nd is query from the Web. so I just have some object that I display on the screen + IMAGES.
Upvotes: 0
Views: 315
Reputation: 6819
I'm not sure about this but this is probably because you are generating the contents of your list view dynamically. Try to overwrite onSaveInstanceState and then save the value of your list there. Then overwrite onRestoreInstanceState and reload your listview there.
Upvotes: 1
Reputation: 1757
May be after starting the intent you are calling finish() method. If that is so remove it.
Upvotes: 0