diff --git a/AndroidManifest.xml b/AndroidManifest.xml index d4a6dea64a3f..e5bad22ad4b9 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="51" + android:versionName="2.11.5" > diff --git a/OpenDocument.apk b/OpenDocument.apk index 0013d5481d42..c280e10a6fa0 100644 Binary files a/OpenDocument.apk and b/OpenDocument.apk differ diff --git a/src/at/tomtasche/reader/ui/activity/MainActivity.java b/src/at/tomtasche/reader/ui/activity/MainActivity.java index b5b777557b95..d33f94992903 100644 --- a/src/at/tomtasche/reader/ui/activity/MainActivity.java +++ b/src/at/tomtasche/reader/ui/activity/MainActivity.java @@ -23,6 +23,7 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.view.ViewGroup; import android.view.WindowManager; import android.widget.EditText; import android.widget.LinearLayout; @@ -244,8 +245,11 @@ public void onAdExpanded(AdLayout arg0) { @Override public void onAdFailedToLoad(AdLayout arg0, AdError arg1) { + ((ViewGroup) madView.getParent()).removeView(madView); ((AdLayout) madView).destroy(); + madView = null; + showGoogleAds(); } @@ -776,7 +780,23 @@ protected void onDestroy() { e.printStackTrace(); } - super.onDestroy(); + try { + // keeps throwing exceptions for some users: + // Caused by: java.lang.NullPointerException + // android.webkit.WebViewClassic.requestFocus(WebViewClassic.java:9898) + // android.webkit.WebView.requestFocus(WebView.java:2133) + // android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:2384) + if (madView != null) { + if (madView instanceof AdView) { + ((AdView) madView).destroy(); + } else if (madView instanceof AdLayout) { + ((AdLayout) madView).destroy(); + } + } + super.onDestroy(); + } catch (Exception e) { + e.printStackTrace(); + } } public String getPublicKey() {