aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines/suma/BusStopActivity.java
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2012-02-17 15:07:20 +0000
committerChristopher Baines <cbaines8@gmail.com>2012-02-17 15:07:20 +0000
commitc15c37286de9bb55bed43f63a38911e9633ced28 (patch)
treef21560fdd249289570a49d95680e1ad04b406676 /src/net/cbaines/suma/BusStopActivity.java
parentfdc65e639563d145b042f9fa3d8be5b27efce8e2 (diff)
downloadsouthamptonuniversitymap-c15c37286de9bb55bed43f63a38911e9633ced28.tar
southamptonuniversitymap-c15c37286de9bb55bed43f63a38911e9633ced28.tar.gz
Somewhat working bus stop movement and bus schedule :)
Diffstat (limited to 'src/net/cbaines/suma/BusStopActivity.java')
-rw-r--r--src/net/cbaines/suma/BusStopActivity.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/net/cbaines/suma/BusStopActivity.java b/src/net/cbaines/suma/BusStopActivity.java
index 5928033..9910ad3 100644
--- a/src/net/cbaines/suma/BusStopActivity.java
+++ b/src/net/cbaines/suma/BusStopActivity.java
@@ -24,6 +24,7 @@ import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.Set;
import org.apache.http.client.ClientProtocolException;
import org.json.JSONException;
@@ -351,14 +352,16 @@ public class BusStopActivity extends OrmLiteBaseActivity<DatabaseHelper> impleme
for (BusRoute route : routes) {
try {
- BusStop tmpStop;
+ Set<BusStop> tmpStops;
if (item.getItemId() == R.id.menu_next_stop) {
- tmpStop = route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), null, 1);
+ tmpStops = route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), 1);
} else {
- tmpStop = route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), null, -1);
+ tmpStops = route.moveInRoute(this, getHelper().getBusStopDao().queryForId(busStopID), -1);
}
- if (!busStops.contains(tmpStop)) {
- busStops.add(tmpStop);
+ for (BusStop busStop : tmpStops) {
+ if (!busStops.contains(busStop)) {
+ busStops.add(busStop);
+ }
}
} catch (SQLException e) {
e.printStackTrace();