Sometimes altosdroid was crashing when messing with configuration bits
like selecting different themes. These fixes seem to make that happen
less.
Signed-off-by: Keith Packard <keithp@keithp.com>
mTab.update_ui(telem_state, state, from_receiver, location, mTab == mTabsAdapter.currentItem());
AltosDebug.debug("quiet %b\n", quiet);
mTab.update_ui(telem_state, state, from_receiver, location, mTab == mTabsAdapter.currentItem());
AltosDebug.debug("quiet %b\n", quiet);
- if (mAltosVoice != null)
+ if (mAltosVoice != null && mTabsAdapter.currentItem() != null)
mAltosVoice.tell(telem_state, state, from_receiver, location, (AltosDroidTab) mTabsAdapter.currentItem(), quiet);
}
mAltosVoice.tell(telem_state, state, from_receiver, location, (AltosDroidTab) mTabsAdapter.currentItem(), quiet);
}
private boolean pad_set;
private Polyline mPolyline;
private boolean pad_set;
private Polyline mPolyline;
- private View map_view;
-
private double mapAccuracy = -1;
private AltosLatLon my_position = null;
private double mapAccuracy = -1;
private AltosLatLon my_position = null;
public static class AltosOnlineMapFragment extends SupportMapFragment {
AltosMapOnline c;
public static class AltosOnlineMapFragment extends SupportMapFragment {
AltosMapOnline c;
public AltosOnlineMapFragment(AltosMapOnline c) {
this.c = c;
}
public AltosOnlineMapFragment(AltosMapOnline c) {
this.c = c;
}
+ public AltosOnlineMapFragment() {
+ }
+
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
+ if (c != null)
+ getMapAsync(c);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- c.map_view = super.onCreateView(inflater, container, savedInstanceState);
- return c.map_view;
+ map_view = super.onCreateView(inflater, container, savedInstanceState);
+ return map_view;
}
@Override
public void onDestroyView() {
super.onDestroyView();
}
@Override
public void onDestroyView() {
super.onDestroyView();
+ map_view = null;
+ }
+ public void set_visible(boolean visible) {
+ if (map_view == null)
+ return;
+ if (visible)
+ map_view.setVisibility(View.VISIBLE);
+ else
+ map_view.setVisibility(View.GONE);
}
public void set_visible(boolean visible) {
}
public void set_visible(boolean visible) {
- if (map_view == null)
- return;
- if (visible)
- map_view.setVisibility(View.VISIBLE);
- else
- map_view.setVisibility(View.GONE);
+ if (mMapFragment != null)
+ mMapFragment.set_visible(visible);
}
public void show(TelemetryState telem_state, AltosState state, AltosGreatCircle from_receiver, Location receiver) {
}
public void show(TelemetryState telem_state, AltosState state, AltosGreatCircle from_receiver, Location receiver) {