File tree Expand file tree Collapse file tree
java/yalantis/com/sidemenu/sample Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 android : theme =" @style/AppTheme" >
1010 <activity
1111 android : name =" .MainActivity"
12+ android : configChanges =" orientation|screenSize"
1213 android : label =" @string/app_name" >
1314 <intent-filter >
1415 <action android : name =" android.intent.action.MAIN" />
Original file line number Diff line number Diff line change @@ -40,12 +40,10 @@ public class MainActivity extends ActionBarActivity implements ViewAnimator.View
4040 protected void onCreate (Bundle savedInstanceState ) {
4141 super .onCreate (savedInstanceState );
4242 setContentView (R .layout .activity_main );
43- if (savedInstanceState == null ) {
44- contentFragment = ContentFragment .newInstance (R .drawable .content_music );
45- getSupportFragmentManager ().beginTransaction ()
46- .add (R .id .content_frame , contentFragment )
47- .commit ();
48- }
43+ contentFragment = ContentFragment .newInstance (R .drawable .content_music );
44+ getSupportFragmentManager ().beginTransaction ()
45+ .replace (R .id .content_frame , contentFragment )
46+ .commit ();
4947 drawerLayout = (DrawerLayout ) findViewById (R .id .drawer_layout );
5048 drawerLayout .setScrimColor (Color .TRANSPARENT );
5149 linearLayout = (LinearLayout ) findViewById (R .id .left_drawer );
You can’t perform that action at this time.
0 commit comments