I am developing an android application, in that I have a listview. Clicking on the list view item starts a new activity.
When I am going back to the parent activity (where the list view is) from the action bar back button on the child activity, it clears the list view of parent activity. But when I am using the android back button it goes back to parent activity but it does not clear the search result (list view).
How can I handle this in action bar back button ?
Example:
ActionBar back button-
1.
ParentActivity Child Activity
ListView
Item1 -- Click an item- -> Details about item1
Item2
Item3
Item4
2.
Child Activity Parent Activity
Details about item1 -- Click back button (The list is gone)
on action bar -->
.
.
.
.
Android back button -
1.
ParentActivity Child Activity
ListView
Item1 -- Click an item- -> Details about item1
Item2
Item3
Item4
2.
Child Activity Parent Activity
(List is still here)
Details about item1 -- Click android back ListView
button --> Item1
Item2
Item3
Item4
Is there any setting or something I need to do to retain the state of parent activity when coming back from child activity ?