Browse Source

Merge pull request #372 from archie94/settings_activity_crash_fix

Set restored fragment to mFragment when Activity is restored
Nathan Freitas 5 months ago
parent
commit
a560765c64
No account linked to committer's email
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/main/java/org/havenapp/main/SettingsActivity.java

+ 2 - 0
src/main/java/org/havenapp/main/SettingsActivity.java

@@ -40,6 +40,8 @@ public class SettingsActivity extends AppCompatActivity {
40 40
             getSupportFragmentManager().beginTransaction()
41 41
                     .add(R.id.settings_fragment, mFragment)
42 42
                     .commit();
43
+        } else {
44
+            mFragment = (SettingsFragment) getSupportFragmentManager().findFragmentById(R.id.settings_fragment);
43 45
         }
44 46
 
45 47
         getSupportActionBar().setDisplayHomeAsUpEnabled(true);