diff --git a/AndroidManifest.xml b/AndroidManifest.xml index bec936d..4ce6efa 100755 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="4" + android:versionName="1.1.2" > loadStations() { if (saveFile) { saveStations(stations); } - } catch (IOException e) { + } catch (Exception e) { printErrorToLog(e); } return stations; diff --git a/src/com/windnow/MainActivity.java b/src/com/windnow/MainActivity.java index e059509..7920822 100755 --- a/src/com/windnow/MainActivity.java +++ b/src/com/windnow/MainActivity.java @@ -57,7 +57,7 @@ @SuppressLint({ "InflateParams", "NewApi" }) public class MainActivity extends ActionBarActivity { - private static final String VERSIONID = "1.1.1"; + private static final String VERSIONID = "1.1.2"; private static final String APPURL = "https://github.com/pulce/WindNow/releases/latest"; private StationListAdapter stAda; @@ -224,10 +224,7 @@ protected Void doInBackground(Void... v) { station.setStatus(Station.LOADED); station.setDate(Calendar.getInstance().getTime()); - if (station.getType() == Station.PIC) { - } else if (station.getType() == Station.BZ) { - station.parseCache(); - } else { + if (station.getType() != Station.PIC) { station.parseCache(); } break; diff --git a/src/com/windnow/Station.java b/src/com/windnow/Station.java index 3781701..e3d5dd9 100755 --- a/src/com/windnow/Station.java +++ b/src/com/windnow/Station.java @@ -68,7 +68,7 @@ public Station(String name, String url) { if (!url.startsWith("http")) { this.url = "http://" + this.url; } - if (url.contains("wetteronline") && url.contains("aktuelles-wetter")) + if (url.contains("wetteronline") && (url.contains("aktuelles-wetter") || url.contains("wetter-aktuell"))) this.type = WC; else if (url.contains("provinz.bz.it") && url.endsWith(".asp")) this.type = BZ; @@ -207,10 +207,13 @@ public void parseCache() { } } catch (IOException e) { LoadSaveOps.printErrorToLog(e); + } catch (Exception e) { + LoadSaveOps.printErrorToLog(e); + this.status = PARSE_ERROR; } } - private static ArrayList parseWC(Document doc) { + private static ArrayList parseWC(Document doc) throws Exception { ArrayList patschText = new ArrayList(); Elements tableElements = doc .select("table[class=hourly]:has(th:contains(Spitze))"); @@ -261,7 +264,7 @@ private static ArrayList parseWC(Document doc) { return patschText; } - private static ArrayList parseBZ(Document doc) { + private static ArrayList parseBZ(Document doc) throws Exception { ArrayList patschText = new ArrayList(); Elements tableElements = doc .select("table[class=avalanches-stations]:contains(Messstationen)"); @@ -320,7 +323,7 @@ private static ArrayList parseBZ(Document doc) { } // Wetterdienst.de - public static ArrayList parseWD(Document doc) { + public static ArrayList parseWD(Document doc) throws Exception { ArrayList patschText = new ArrayList(); Elements tableElements = doc.select("table[class=weather-table]"); // Headers diff --git a/src/com/windnow/StationPicActivity.java b/src/com/windnow/StationPicActivity.java index b904ce5..eddccec 100755 --- a/src/com/windnow/StationPicActivity.java +++ b/src/com/windnow/StationPicActivity.java @@ -1,7 +1,6 @@ package com.windnow; import java.io.FileInputStream; -import java.io.IOException; import android.support.v4.app.NavUtils; import android.support.v7.app.ActionBarActivity; @@ -73,12 +72,12 @@ protected void onCreate(Bundle savedInstanceState) { FileInputStream is = this.openFileInput(filename); pic = BitmapFactory.decodeStream(is); is.close(); - } catch (IOException e) { + imageDetail.setImageBitmap(pic); + } catch (Exception e) { LoadSaveOps.printErrorToLog(e); } - imageDetail.setImageBitmap(pic); - imageDetail.setOnTouchListener(new View.OnTouchListener() { + imageDetail.setOnTouchListener(new View.OnTouchListener() { @SuppressLint("ClickableViewAccessibility") @Override public boolean onTouch(View v, MotionEvent event) { @@ -123,7 +122,7 @@ public boolean onTouch(View v, MotionEvent event) { matrix.postScale(scale, scale, midPoint.x, midPoint.y); matrix.postTranslate(event.getX() - startPoint.x, - event.getY() - startPoint.y); //new + event.getY() - startPoint.y); // new } } break;