aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines/suma/BusStopActivity.java
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2012-02-02 18:39:00 +0000
committerChristopher Baines <cbaines8@gmail.com>2012-02-02 18:39:00 +0000
commit6fe849cc34a06a3f5d7662ea6a4566a870b3edfa (patch)
treeb8a3afd2adff9341932f540801e1c80151d55de9 /src/net/cbaines/suma/BusStopActivity.java
parentb47ae24a17925619029500a56998860496ce308f (diff)
downloadsouthamptonuniversitymap-6fe849cc34a06a3f5d7662ea6a4566a870b3edfa.tar
southamptonuniversitymap-6fe849cc34a06a3f5d7662ea6a4566a870b3edfa.tar.gz
Improvements to the Preference management, begin allowing more bus data, need to rethink the data storage and retreval, perhaps using more semantic web stuff...
Diffstat (limited to 'src/net/cbaines/suma/BusStopActivity.java')
-rw-r--r--src/net/cbaines/suma/BusStopActivity.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java
index 93f4ae6..d84bbdd 100644
--- a/src/net/cbaines/suma/BusStopActivity.java
+++ b/src/net/cbaines/suma/BusStopActivity.java
@@ -53,7 +53,7 @@ import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.stmt.PreparedQuery;
import com.j256.ormlite.stmt.QueryBuilder;
-public class BusStopActivity extends OrmLiteBaseActivity<DatabaseHelper> implements OnCheckedChangeListener {
+public class BusStopActivity extends OrmLiteBaseActivity<DatabaseHelper> implements OnCheckedChangeListener, Preferences {
final static String TAG = "BusTimeActivity";
@@ -199,7 +199,7 @@ public class BusStopActivity extends OrmLiteBaseActivity<DatabaseHelper> impleme
super.onResume();
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
- if (sharedPrefs.getBoolean("liveBusTimesEnabled", false)) {
+ if (sharedPrefs.getBoolean(UNI_LINK_BUS_TIMES, false) || sharedPrefs.getBoolean(NON_UNI_LINK_BUS_TIMES, false)) {
Log.i(TAG, "Live Times enabled");
timetable = (Timetable) getLastNonConfigurationInstance();
@@ -287,7 +287,11 @@ public class BusStopActivity extends OrmLiteBaseActivity<DatabaseHelper> impleme
protected Timetable doInBackground(String... activity) {
Timetable newTimetable = null;
try {
- newTimetable = DataManager.getTimetable(instance, busStopID, true);
+ final SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(instance);
+
+ newTimetable = DataManager.getTimetable(instance, busStopID, sharedPrefs.getBoolean(SouthamptonUniversityMapActivity.UNI_LINK_BUS_TIMES,
+ SouthamptonUniversityMapActivity.UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT), sharedPrefs.getBoolean(
+ SouthamptonUniversityMapActivity.NON_UNI_LINK_BUS_TIMES, SouthamptonUniversityMapActivity.NON_UNI_LINK_BUS_TIMES_ENABLED_BY_DEFAULT));
} catch (SQLException e) {
errorMessage = "Error message regarding SQL?";
e.printStackTrace();