GeezerVison is showing github.com — fix orientation change crash · AndroidshadowX/Side-Menu.Android@2c23bff
File tree
Expand file treeCollapse file tree
Open diff view settings
java/yalantis/com/sidemenu/sample
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/AndroidManifest.xml +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
9 | 9 | android:theme="@style/AppTheme"> |
10 | 10 | <activity |
11 | 11 | android:name=".MainActivity" |
| 12 | + android:configChanges="orientation|screenSize" |
12 | 13 | android:label="@string/app_name"> |
13 | 14 | <intent-filter> |
14 | 15 | <action android:name="android.intent.action.MAIN"/> |
|
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/yalantis/com/sidemenu/sample/MainActivity.java +4-6Lines changed: 4 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -40,12 +40,10 @@ public class MainActivity extends ActionBarActivity implements ViewAnimator.View |
40 | 40 | protected void onCreate(Bundle savedInstanceState) { |
41 | 41 | super.onCreate(savedInstanceState); |
42 | 42 | 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(); |
49 | 47 | drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); |
50 | 48 | drawerLayout.setScrimColor(Color.TRANSPARENT); |
51 | 49 | linearLayout = (LinearLayout) findViewById(R.id.left_drawer); |
|