mirror of
https://github.com/MatomoCamp/matomocamp-companion-android.git
synced 2024-09-19 16:13:46 +02:00
Fix: properly reuse the startup fragment in MainActivity after is has
been detached by setting its tag.
This commit is contained in:
parent
e1e3db0ae4
commit
831539359d
1 changed files with 3 additions and 2 deletions
|
@ -211,8 +211,9 @@ public class MainActivity extends ActionBarActivity implements ListView.OnItemCl
|
||||||
// Restore current section
|
// Restore current section
|
||||||
if (savedInstanceState == null) {
|
if (savedInstanceState == null) {
|
||||||
currentSection = Section.TRACKS;
|
currentSection = Section.TRACKS;
|
||||||
Fragment f = Fragment.instantiate(this, currentSection.getFragmentClassName());
|
String fragmentClassName = currentSection.getFragmentClassName();
|
||||||
getSupportFragmentManager().beginTransaction().add(R.id.content, f).commit();
|
Fragment f = Fragment.instantiate(this, fragmentClassName);
|
||||||
|
getSupportFragmentManager().beginTransaction().add(R.id.content, f, fragmentClassName).commit();
|
||||||
} else {
|
} else {
|
||||||
currentSection = Section.values()[savedInstanceState.getInt(STATE_CURRENT_SECTION)];
|
currentSection = Section.values()[savedInstanceState.getInt(STATE_CURRENT_SECTION)];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue