Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix force close on orientation change while refreshing the schedule

  • Loading branch information...
commit bd068ba09659c9d5b1f6fd03582b0ae488a7f57f 1 parent 3b0edb0
@tuxmobil authored
View
2  AndroidManifest.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="nerd.tuxmobil.fahrplan.camp11" android:versionName="1.03" android:versionCode="4">
+ package="nerd.tuxmobil.fahrplan.camp11" android:versionCode="5" android:versionName="1.04">
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="7"/>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
2  libs/ActionBar
@@ -1 +1 @@
-Subproject commit a6249b7d2244b19653bc73986183b6b83cb19649
+Subproject commit 87b66c2712c536dd3ed8098f01b0b4f634cc3065
View
52 src/nerd/tuxmobil/fahrplan/camp11/Fahrplan.java
@@ -129,12 +129,15 @@ public int getDrawable() {
public String getText() {
return getString(R.string.day);
}
+
+ @Override
+ public void ready(View view) {
+ }
});
actionBar.addAction(new Action() {
@Override
public void performAction(View view) {
- refreshBtn = view;
fetchFahrplan();
}
@Override
@@ -145,6 +148,11 @@ public int getDrawable() {
public String getText() {
return null;
}
+
+ @Override
+ public void ready(View view) {
+ refreshBtn = view;
+ }
});
// final TextView leftText = (TextView) findViewById(R.id.title_left_text);
@@ -870,14 +878,7 @@ public void onParseDone(Boolean result, String version) {
Log.d(LOG_TAG, "parseDone: " + result);
MyApp.task_running = TASKS.NONE;
MyApp.fahrplan_xml = null;
- boolean refreshDisplay = false;
- if (result) {
- if ((MyApp.numdays == 0) || (!version.equals(MyApp.version))) {
- refreshDisplay = true;
- }
- } else {
- // FIXME Fehlermeldung;
- }
+
setProgressBarIndeterminateVisibility(false);
if (MyApp.numdays == 0) {
progress.dismiss();
@@ -887,21 +888,26 @@ public void onParseDone(Boolean result, String version) {
statusBar.setVisibility(View.GONE);
refreshBtn.setVisibility(View.VISIBLE);
}
-
- if (refreshDisplay) {
- loadMeta();
- loadDays();
- SharedPreferences prefs = getSharedPreferences(PREFS_NAME, 0);
- day = prefs.getInt("displayDay", 1);
- if (day > MyApp.numdays) {
- day = 1;
+ if (result) {
+ if ((MyApp.numdays == 0) || (!version.equals(MyApp.version))) {
+ loadMeta();
+ loadDays();
+ SharedPreferences prefs = getSharedPreferences(PREFS_NAME, 0);
+ day = prefs.getInt("displayDay", 1);
+ if (day > MyApp.numdays) {
+ day = 1;
+ }
+ viewDay(true);
+ final Toast done = Toast.makeText(global
+ .getApplicationContext(), String.format(
+ getString(R.string.aktualisiert_auf), version),
+ Toast.LENGTH_LONG);
+ done.show();
+ } else {
+ viewDay(false);
}
- viewDay(true);
- final Toast done = Toast.makeText(global
- .getApplicationContext(), String.format(
- getString(R.string.aktualisiert_auf), version),
- Toast.LENGTH_LONG);
- done.show();
+ } else {
+ // FIXME Fehlermeldung;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.