Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b97bfb08 authored by Emily Chuang's avatar Emily Chuang
Browse files

Fix a bug where cards overlap when rotating the screen

Check if a certain fragment has been added before. If it's added, then
just show it instead of re-adding it again.

Bug: 118344247
Test: visual
Change-Id: I039a3a7372e163c6bcda386d2aea99e6f8c8e9b1
parent 5cec560c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -65,7 +65,13 @@ public class SettingsHomepageActivity extends SettingsBaseActivity {
    private void showFragment(Fragment fragment, int id, String tag) {
        final FragmentManager fragmentManager = getSupportFragmentManager();
        final FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        final Fragment showFragment = fragmentManager.findFragmentById(id);

        if (showFragment == null) {
            fragmentTransaction.add(id, fragment, tag);
        } else {
            fragmentTransaction.show(showFragment);
        }
        fragmentTransaction.commit();
    }
}
 No newline at end of file