From: Keith Packard Date: Tue, 17 Feb 2015 06:22:37 +0000 (-0800) Subject: altosdroid: Ignore automatic tab changing while activity is saved X-Git-Tag: 1.6.0.3~122^2 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=106b16b4d5d024543d7ad8c4b4762151e253f3c4 altosdroid: Ignore automatic tab changing while activity is saved 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 --- diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java index f61e7ef2..0896b3a3 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java @@ -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) {