aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2012-01-23 23:31:40 +0000
committerChristopher Baines <cbaines8@gmail.com>2012-01-23 23:31:40 +0000
commitf13680dc5ca55401484ea23fc9493a938cb8ae73 (patch)
tree067f4f64c402ce5e041a62cb31b38231911aeaf0 /src
parent591bb6b492edbfcb868ef690c8fc622a5ca2f58e (diff)
downloadsouthamptonuniversitymap-f13680dc5ca55401484ea23fc9493a938cb8ae73.tar
southamptonuniversitymap-f13680dc5ca55401484ea23fc9493a938cb8ae73.tar.gz
Fixed an issue causing the favourites dialog to be blank after device rotation.
Diffstat (limited to 'src')
-rw-r--r--src/net/cbaines/suma/FavouriteDialog.java2
-rw-r--r--src/net/cbaines/suma/SouthamptonUniversityMapActivity.java9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/net/cbaines/suma/FavouriteDialog.java b/src/net/cbaines/suma/FavouriteDialog.java
index 53a9862..e95ead2 100644
--- a/src/net/cbaines/suma/FavouriteDialog.java
+++ b/src/net/cbaines/suma/FavouriteDialog.java
@@ -60,6 +60,8 @@ public class FavouriteDialog extends Dialog {
favouriteItems = new ArrayList<POI>();
listItems = (ListView) findViewById(R.id.favouriteListItems);
+
+ refresh();
}
public void refresh() {
diff --git a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java
index 5b134c6..f183542 100644
--- a/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java
+++ b/src/net/cbaines/suma/SouthamptonUniversityMapActivity.java
@@ -29,6 +29,7 @@ import java.util.HashMap;
import org.osmdroid.DefaultResourceProxyImpl;
import org.osmdroid.ResourceProxy;
+import org.osmdroid.tileprovider.MapTileProviderArray;
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapController;
@@ -190,11 +191,11 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity<Databa
} else {
myLocationOverlay.disableMyLocation();
}
-
+
if (!sharedPrefs.contains("GPSEnabled")) {
sharedPrefs.edit().putBoolean("GPSEnabled", true).commit();
}
-
+
if (!sharedPrefs.contains("liveBusTimesEnabled")) {
sharedPrefs.edit().putBoolean("liveBusTimesEnabled", true).commit();
}
@@ -766,9 +767,11 @@ public class SouthamptonUniversityMapActivity extends OrmLiteBaseActivity<Databa
return false;
case R.id.menu_favourites:
Log.i(TAG, "Showing favourite dialog");
+ boolean refreshNeeded = favDialog != null;
showDialog(FAVOURITE_DIALOG_ID);
if (favDialog != null) {
- favDialog.refresh();
+ if (refreshNeeded)
+ favDialog.refresh();
} else {
Log.e(TAG, "Very wierd, just tried to launch the favourite's dialog, but its null?");
}