Permalink
Browse files

fix orientation change crash

  • Loading branch information...
kotya341 committed Feb 13, 2015
1 parent 3bb94cd commit 2c23bff1dbebb87b3a3291e3f7d629cc0d5efbfa
@@ -9,6 +9,7 @@
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
@@ -40,12 +40,10 @@
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
contentFragment = ContentFragment.newInstance(R.drawable.content_music);
getSupportFragmentManager().beginTransaction()
.add(R.id.content_frame, contentFragment)
.commit();
}
contentFragment = ContentFragment.newInstance(R.drawable.content_music);
getSupportFragmentManager().beginTransaction()
.replace(R.id.content_frame, contentFragment)
.commit();
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
drawerLayout.setScrimColor(Color.TRANSPARENT);
linearLayout = (LinearLayout) findViewById(R.id.left_drawer);

0 comments on commit 2c23bff

Please sign in to comment.