altosdroid: Don't display MISSING flight number
authorKeith Packard <keithp@keithp.com>
Sun, 16 Nov 2014 06:46:01 +0000 (22:46 -0800)
committerKeith Packard <keithp@keithp.com>
Sun, 16 Nov 2014 06:46:01 +0000 (22:46 -0800)
Just check and clear the entry if we end up seeing that value

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

index f6cceac947dbab97cc6b6d838a7fd22e2f21f960..e883322c57c23fff1580b21d51cd098a31b8f81e 100644 (file)
@@ -337,7 +337,10 @@ public class AltosDroid extends FragmentActivity implements AltosUnitsListener {
                        }
                        if (saved_state == null || state.flight != saved_state.flight) {
                                Log.d(TAG, "update flight");
-                               mFlightView.setText(String.format("%d", state.flight));
+                               if (state.flight == AltosLib.MISSING)
+                                       mFlightView.setText("");
+                               else
+                                       mFlightView.setText(String.format("%d", state.flight));
                        }
                        if (saved_state == null || state.state != saved_state.state) {
                                Log.d(TAG, "update state");