9 |
import android.content.Intent; |
import android.content.Intent; |
10 |
import android.content.SharedPreferences; |
import android.content.SharedPreferences; |
11 |
import android.content.SharedPreferences.Editor; |
import android.content.SharedPreferences.Editor; |
|
import android.net.Uri; |
|
12 |
import android.os.AsyncTask; |
import android.os.AsyncTask; |
13 |
import android.os.Bundle; |
import android.os.Bundle; |
14 |
import android.os.Handler; |
import android.os.Handler; |
21 |
import android.widget.Button; |
import android.widget.Button; |
22 |
import android.widget.Toast; |
import android.widget.Toast; |
23 |
|
|
24 |
import com.nullwire.trace.ExceptionHandler; |
//import com.nullwire.trace.ExceptionHandler; |
25 |
|
|
26 |
import dk.thoerup.androidutils.CheckUpdates; |
import dk.thoerup.androidutils.CheckUpdates; |
27 |
import dk.thoerup.traininfo.provider.OfflineStationProvider; |
import dk.thoerup.traininfo.provider.OfflineStationProvider; |
42 |
ListFavorites |
ListFavorites |
43 |
} |
} |
44 |
|
|
45 |
|
|
46 |
Handler handler = new Handler(); |
Handler handler = new Handler(); |
47 |
|
|
48 |
SharedPreferences prefs; |
SharedPreferences prefs; |
73 |
|
|
74 |
//Got stacktraces / reports that the register thing sometimes crashes |
//Got stacktraces / reports that the register thing sometimes crashes |
75 |
try { |
try { |
76 |
ExceptionHandler.register(this, "http://t-hoerup.dk/android/trace.php"); |
//ExceptionHandler.register(this, "http://t-hoerup.dk/android/trace.php"); |
77 |
} catch (Exception e) { |
} catch (Exception e) { |
78 |
Log.e("TrainInfo", "Error registering exception handler", e); |
Log.e("TrainInfo", "Error registering exception handler", e); |
79 |
} |
} |
124 |
} |
} |
125 |
|
|
126 |
} |
} |
127 |
|
|
128 |
|
|
129 |
} |
} |
130 |
|
|
131 |
|
|
132 |
|
|
|
|
|
133 |
@Override |
@Override |
134 |
protected void onDestroy() { |
protected void onDestroy() { |
135 |
super.onDestroy(); |
super.onDestroy(); |
136 |
if (stationLoader != null) { |
if (stationLoader != null) { |
137 |
stationLoader.cancel(true); |
stationLoader.cancel(true); |
138 |
} |
stationLoader = null; |
139 |
|
} |
140 |
|
|
141 |
ProviderFactory.purgeOldEntries(); //exiting application, do some cleanup |
ProviderFactory.purgeOldEntries(); //exiting application, do some cleanup |
142 |
} |
} |
277 |
Log.i("TrainInfo", "StationLoader.onPostExecute() "); |
Log.i("TrainInfo", "StationLoader.onPostExecute() "); |
278 |
|
|
279 |
if (silent == false) { |
if (silent == false) { |
280 |
dlg.dismiss(); |
try { |
281 |
|
dlg.dismiss(); |
282 |
|
} catch (Exception e) { |
283 |
|
Log.e("TrainInfo", "Exception while closing dialog", e); // don't crash program |
284 |
|
} |
285 |
dlg = null; |
dlg = null; |
286 |
} |
} |
287 |
|
|