Renamed project to BARTRunner

This commit is contained in:
dkeen 2011-06-20 15:34:09 -07:00
parent b3e112a845
commit 5a4d549398
4 changed files with 18 additions and 8 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DontMissTheBart</name>
<name>BARTRunner</name>
<comment></comment>
<projects>
</projects>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">BART Catcher</string>
<string name="app_name">BART Runner</string>
<string name="favorite_routes">Favorite Routes</string>
<string name="empty_favorites_list_message">Press the menu button and select \"Add route\" to
add a route</string>

View File

@ -33,7 +33,7 @@ public abstract class GetRealTimeDeparturesTask
private final static String API_KEY = "5LD9-IAYI-TRAT-MHHW";
private final static String API_URL = "http://api.bart.gov/api/etd.aspx?cmd=etd&key="
+ API_KEY + "&orig=%1$s&dir=%2$s";
private final static int MAX_ATTEMPTS = 3;
private final static int MAX_ATTEMPTS = 5;
private Exception mException;
@ -93,9 +93,9 @@ public abstract class GetRealTimeDeparturesTask
if (attemptNumber < MAX_ATTEMPTS - 1) {
try {
Log.w(Constants.TAG,
"Attempt to contact server failed... retrying in 5s",
"Attempt to contact server failed... retrying in 3s",
e);
Thread.sleep(5000);
Thread.sleep(3000);
} catch (InterruptedException interrupt) {
// Ignore... just go on to next attempt
}

View File

@ -97,13 +97,23 @@ public class ViewDeparturesActivity extends ListActivity {
setListAdapter(mDeparturesAdapter);
}
@Override
protected void onPause() {
cancelDataFetch();
super.onPause();
}
@Override
protected void onDestroy() {
cancelDataFetch();
super.onDestroy();
}
private void cancelDataFetch() {
if (mGetDeparturesTask != null) {
mGetDeparturesTask.cancel(true);
mDataFetchIsPending = false;
}
super.onDestroy();
}
@Override
@ -123,8 +133,8 @@ public class ViewDeparturesActivity extends ListActivity {
if (!mDataFetchIsPending) {
fetchLatestDepartures();
}
PowerManager powerManaer = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = powerManaer
PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = powerManager
.newWakeLock(
PowerManager.SCREEN_DIM_WAKE_LOCK,
"ViewDeparturesActivity");