aboutsummaryrefslogtreecommitdiff
path: root/src/net/cbaines/suma/BusActivity.java
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2012-02-16 22:35:53 +0000
committerChristopher Baines <cbaines8@gmail.com>2012-02-16 22:35:53 +0000
commit3f10264e8dba0cd972647fbe1379f148b1ee6847 (patch)
tree2219a824f9aa865c1836998eb46757db6e708545 /src/net/cbaines/suma/BusActivity.java
parent86629c735d4f7c48e1562825ca63ba3335363cbb (diff)
downloadsouthamptonuniversitymap-3f10264e8dba0cd972647fbe1379f148b1ee6847.tar
southamptonuniversitymap-3f10264e8dba0cd972647fbe1379f148b1ee6847.tar.gz
More progress on the route movement stuff, identified the bus stops that need addressing manualy, however I need to redefine the concept
of direction. As all of the routes that direction applies are circular, direction is only relevent for dealing with the bus stops that are present in the route more than once.
Diffstat (limited to 'src/net/cbaines/suma/BusActivity.java')
-rw-r--r--src/net/cbaines/suma/BusActivity.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net/cbaines/suma/BusActivity.java b/src/net/cbaines/suma/BusActivity.java
index a71cbd3..25f373a 100644
--- a/src/net/cbaines/suma/BusActivity.java
+++ b/src/net/cbaines/suma/BusActivity.java
@@ -20,7 +20,6 @@ import android.view.Gravity;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ListView;
-import android.widget.ProgressBar;
import android.widget.TextView;
import com.j256.ormlite.android.apptools.OrmLiteBaseActivity;
@@ -48,7 +47,7 @@ public class BusActivity extends OrmLiteBaseActivity<DatabaseHelper> implements
*/
private BusStop busStop;
- private Runnable refreshData;
+ Runnable refreshData;
protected Timetable timetable;
private Timetable visibleTimetable;
@@ -63,7 +62,7 @@ public class BusActivity extends OrmLiteBaseActivity<DatabaseHelper> implements
private HashMap<BusStop, GetTimetableStopTask> tasks = new HashMap<BusStop, GetTimetableStopTask>();
- private Handler handler;
+ Handler handler;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -180,17 +179,16 @@ public class BusActivity extends OrmLiteBaseActivity<DatabaseHelper> implements
task = new GetTimetableStopTask();
BusStop[] str = { stop.busStop };
task.execute(str);
- handler.postDelayed(refreshData, 20000);
} else {
if (task.getStatus() == AsyncTask.Status.FINISHED) {
BusStop[] str = { stop.busStop };
task.execute(str);
- handler.postDelayed(refreshData, 20000);
}
}
}
}
}
+ handler.postDelayed(refreshData, 20000);
}
};
@@ -213,12 +211,13 @@ public class BusActivity extends OrmLiteBaseActivity<DatabaseHelper> implements
for (int i = 0; i < busStops.size(); i++) {
timetable.add(new Stop(bus, busStops.get(i), null, null, false));
}
+ Log.v(TAG, "Finished adding placeholder stops");
} else {
Log.i(TAG, "Displaying previous timetable");
}
displayTimetable(timetable);
- handler.post(refreshData);
+ handler.postDelayed(refreshData, 500);
} else {
Log.i(TAG, "Live Times Disabled");
@@ -256,6 +255,7 @@ public class BusActivity extends OrmLiteBaseActivity<DatabaseHelper> implements
protected Stop doInBackground(BusStop... busStopArray) {
busStop = busStopArray[0];
+ position = busStops.indexOf(busStop);
Stop stop = null;
try {