File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,14 @@ public void onCreate(Bundle savedInstanceState) {
33
33
34
34
// set the Behind View
35
35
setBehindContentView (R .layout .menu_frame );
36
- FragmentTransaction t = this .getSupportFragmentManager ().beginTransaction ();
37
- mFrag = new SampleListFragment ();
38
- t .replace (R .id .menu_frame , mFrag );
39
- t .commit ();
36
+ if (savedInstanceState == null ) {
37
+ FragmentTransaction t = this .getSupportFragmentManager ().beginTransaction ();
38
+ mFrag = new SampleListFragment ();
39
+ t .replace (R .id .menu_frame , mFrag );
40
+ t .commit ();
41
+ } else {
42
+ mFrag = (ListFragment )this .getSupportFragmentManager ().findFragmentById (R .id .menu_frame );
43
+ }
40
44
41
45
// customize the SlidingMenu
42
46
SlidingMenu sm = getSlidingMenu ();
You can’t perform that action at this time.
0 commit comments