The map tabs may not have been created when the map type was selected,
so save the desired type in the main application object.
Signed-off-by: Keith Packard <keithp@keithp.com>
public static final int REQUEST_PRELOAD_MAPS = 3;
public static final int REQUEST_MAP_TYPE = 4;
public static final int REQUEST_PRELOAD_MAPS = 3;
public static final int REQUEST_MAP_TYPE = 4;
+ public int map_type = AltosMap.maptype_hybrid;
+
public static FragmentManager fm;
private BluetoothAdapter mBluetoothAdapter = null;
public static FragmentManager fm;
private BluetoothAdapter mBluetoothAdapter = null;
}
private void set_map_type(Intent data) {
}
private void set_map_type(Intent data) {
- int mode = data.getIntExtra(MapTypeActivity.EXTRA_MAP_TYPE, -1);
+ int type = data.getIntExtra(MapTypeActivity.EXTRA_MAP_TYPE, -1);
- AltosDebug.debug("intent set_map_type %d\n", mode);
- if (mode != -1) {
+ AltosDebug.debug("intent set_map_type %d\n", type);
+ if (type != -1) {
+ map_type = type;
for (AltosDroidTab mTab : mTabs)
for (AltosDroidTab mTab : mTabs)
- mTab.set_map_type(mode);
+ mTab.set_map_type(map_type);
private void setupMap() {
mMap = mMapFragment.getMap();
if (mMap != null) {
private void setupMap() {
mMap = mMapFragment.getMap();
if (mMap != null) {
+ set_map_type(mAltosDroid.map_type);
mMap.setMyLocationEnabled(true);
mMap.getUiSettings().setTiltGesturesEnabled(false);
mMap.getUiSettings().setZoomControlsEnabled(false);
mMap.setMyLocationEnabled(true);
mMap.getUiSettings().setTiltGesturesEnabled(false);
mMap.getUiSettings().setZoomControlsEnabled(false);
super.onAttach(activity);
mAltosDroid = (AltosDroid) activity;
mAltosDroid.registerTab(this);
super.onAttach(activity);
mAltosDroid = (AltosDroid) activity;
mAltosDroid.registerTab(this);
+
+ map = new AltosMap(this);
+ map.set_maptype(mAltosDroid.map_type);
+
pad_bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.pad);
/* arrow at the bottom of the launchpad image */
pad_off_x = pad_bitmap.getWidth() / 2;
pad_bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.pad);
/* arrow at the bottom of the launchpad image */
pad_off_x = pad_bitmap.getWidth() / 2;