47 |
|
|
48 |
SharedPreferences prefs; |
SharedPreferences prefs; |
49 |
|
|
50 |
|
StationLoader stationLoader; |
51 |
|
|
52 |
@Override |
@Override |
53 |
public void onCreate(Bundle savedInstanceState) { |
public void onCreate(Bundle savedInstanceState) { |
54 |
|
|
95 |
Log.i("TrainInfo", "Last Load: " + last); |
Log.i("TrainInfo", "Last Load: " + last); |
96 |
|
|
97 |
if ( (now-last) > (14*24*60*60*1000) ) { |
if ( (now-last) > (14*24*60*60*1000) ) { |
98 |
new StationLoader(osp).execute( (Void)null); |
stationLoader = new StationLoader(osp); |
99 |
|
stationLoader.execute( (Void)null); |
100 |
} else { |
} else { |
101 |
|
|
102 |
boolean didLoad = false; |
boolean didLoad = false; |
113 |
} |
} |
114 |
|
|
115 |
if (didLoad == false) { |
if (didLoad == false) { |
116 |
new StationLoader(osp).execute( (Void)null); |
stationLoader = new StationLoader(osp); |
117 |
|
stationLoader.execute( (Void)null); |
118 |
} |
} |
119 |
} |
} |
120 |
|
|
126 |
@Override |
@Override |
127 |
protected void onDestroy() { |
protected void onDestroy() { |
128 |
super.onDestroy(); |
super.onDestroy(); |
129 |
|
if (stationLoader != null) { |
130 |
|
stationLoader.cancel(false); |
131 |
|
} |
132 |
|
|
133 |
ProviderFactory.purgeOldEntries(); //exiting application, do some cleanup |
ProviderFactory.purgeOldEntries(); //exiting application, do some cleanup |
134 |
} |
} |
135 |
|
|