GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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
Filter options
  • app/src/main
    • AndroidManifest.xml
    • java/yalantis/com/sidemenu/sample
      • MainActivity.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app/src/main/AndroidManifest.xml‎

Copy file name to clipboardExpand all lines: app/src/main/AndroidManifest.xml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
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"/>
Collapse file

‎app/src/main/java/yalantis/com/sidemenu/sample/MainActivity.java‎

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 numberDiff line numberDiff 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);

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.