aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines/suma/BusStopActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/cbaines/suma/BusStopActivity.java')
-rw-r--r--src/net/cbaines/suma/BusStopActivity.java30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java
index 62a0f54..55a0bd6 100644
--- a/src/net/cbaines/suma/BusStopActivity.java
+++ b/src/net/cbaines/suma/BusStopActivity.java
@@ -77,8 +77,6 @@ public class BusStopActivity extends OrmLiteBaseActivity<DatabaseHelper> impleme
protected Timetable timetable;
private Timetable visibleTimetable;
- private Dao<BusStop, String> busStopDao;
-
private BusStop busStop;
private GetTimetableTask timetableTask;
@@ -205,10 +203,6 @@ public class BusStopActivity extends OrmLiteBaseActivity<DatabaseHelper> impleme
}
}
- busStopDao = helper.getBusStopDao();
-
- busStop = busStopDao.queryForId(busStopID);
-
busFavourite = (CheckBox) findViewById(R.id.favouriteCheckBox);
busFavourite.setChecked(favouritesPreferences.getBoolean(busStop.id, false));
busFavourite.setOnCheckedChangeListener(this);
@@ -516,27 +510,17 @@ public class BusStopActivity extends OrmLiteBaseActivity<DatabaseHelper> impleme
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Log.i(TAG, "OnItemClick pos " + position + " id " + id);
- String poiId = busDialog.adapter.getItemStringId(position);
+ String busId = busDialog.adapter.getItemStringId(position);
- Log.i(TAG, "POI " + poiId + " selected");
+ Log.i(TAG, "Bus " + busId + " selected");
- Intent i = new Intent(this, BusStopActivity.class);
- try {
- busStop = busStopDao.queryForId(poiId);
+ Uri uri = Uri.parse("http://id.southampton.ac.uk/bus/" + busId);
- if (busStop == null) {
- Log.e(TAG, "stop == null");
- }
- if (busStop.id == null) {
- Log.e(TAG, "stop.id == null");
- }
- i.putExtra("busStopID", busStop.id);
- i.putExtra("busStopName", busStop.description);
- startActivity(i);
- } catch (SQLException e) {
- e.printStackTrace();
- }
+ Log.i(TAG, "Starting a activity for " + uri + " path " + uri.getPath());
+ Intent busStopIntent = new Intent(Intent.ACTION_VIEW, uri);
+ busStopIntent.putExtra("busStopID", busStop.id);
+ startActivity(busStopIntent);
}
public boolean onLongClick(View v) {