altosdroid: Ignore automatic tab changing while activity is saved
authorKeith Packard <keithp@keithp.com>
Tue, 17 Feb 2015 06:22:37 +0000 (22:22 -0800)
committerKeith Packard <keithp@keithp.com>
Tue, 17 Feb 2015 06:22:37 +0000 (22:22 -0800)
When the activity state is saved (after onSaveInstanceState()), we
can't update the UI until the activity is restarted or restored; that
means any UI changes we make, like switching tabs, must deal with this
by allowing those changes to be ignored, using commitAllowingStateLoss
instead of commit.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java

index f61e7ef2a4183bf92fe0cbfc7c475352c27713ee..0896b3a32b76b35b79e91af40a576b6409fca6b3 100644 (file)
@@ -64,7 +64,7 @@ public abstract class AltosDroidTab extends Fragment implements AltosUnitsListen
                        ft.show(this);
                } else
                        ft.hide(this);
-               ft.commit();
+               ft.commitAllowingStateLoss();
        }
 
        public void update_ui(AltosState state, AltosGreatCircle from_receiver, Location receiver, boolean is_current) {