Android: Stop activity recreate when theme is set

Hopefully will fix those crashes on startup.
This commit is contained in:
Connor McLaughlin 2021-03-21 17:22:32 +10:00
parent 237c0a01b6
commit 4c3d2cd3fe
1 changed files with 3 additions and 2 deletions

View File

@ -137,14 +137,15 @@ public class MainActivity extends AppCompatActivity {
.beginTransaction()
.setReorderingAllowed(true).
replace(R.id.content_fragment, listFragment)
.commit();
.commitAllowingStateLoss();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
loadSettings();
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);