Restore listView in android
I am navigating from Activity_A to Activity_B and showing a list view in Activity_B , when I press back button in Activity_B control comes to Activity_A. Now, again I navigate to Activity_B, now I dont want to create the list View once again instea开发者_如何学JAVAd I want to show the list View previously created. How to do this ? Any one please help me...
Thanks in advance....
when you start Activity_B set the Flag
FLAG_ACTIVITY_REORDER_TO_FRONT
Intent intent = new Intent(Activity_A.this, Activity_B.class);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);
this flag will cause the launched activity to be brought to the front of its task's history stack if it is already running.
You need to save your Activity's state.
http://developer.android.com/guide/topics/fundamentals/tasks-and-back-stack.html
精彩评论