summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java29
1 files changed, 12 insertions, 17 deletions
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java
index b960eb1a..7b5b01b3 100644
--- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java
+++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidTab.java
@@ -39,37 +39,32 @@ public abstract class AltosDroidTab extends Fragment {
public void set_visible(boolean visible) {
FragmentTransaction ft = AltosDroid.fm.beginTransaction();
- if (visible)
+ if (visible) {
+ AltosState state = last_state;
+ AltosGreatCircle from_receiver = last_from_receiver;
+ Location receiver = last_receiver;
+
+ last_state = null;
+ last_from_receiver = null;
+ last_receiver = null;
+ show(state, from_receiver, receiver);
ft.show(this);
- else
+ } else
ft.hide(this);
ft.commit();
}
public void update_ui(AltosState state, AltosGreatCircle from_receiver, Location receiver, boolean is_current) {
if (is_current) {
- Log.d(AltosDroid.TAG, String.format("%s: visible, performing update", tab_name()));
+ if (AltosDroid.D) Log.d(AltosDroid.TAG, String.format("%s: visible, performing update", tab_name()));
show(state, from_receiver, receiver);
} else {
- Log.d(AltosDroid.TAG, String.format("%s: not visible, skipping update", tab_name()));
+ if (AltosDroid.D) Log.d(AltosDroid.TAG, String.format("%s: not visible, skipping update", tab_name()));
last_state = state;
last_from_receiver = from_receiver;
last_receiver = receiver;
return;
}
}
-
- public void onHiddenChanged(boolean hidden) {
- if (last_state != null && isVisible()) {
- AltosState state = last_state;
- AltosGreatCircle from_receiver = last_from_receiver;
- Location receiver = last_receiver;
-
- last_state = null;
- last_from_receiver = null;
- last_receiver = null;
- show(state, from_receiver, receiver);
- }
- }
}