Skip to content

Commit

Permalink
(Android): Fix app crash when resuming from background after Talkback…
Browse files Browse the repository at this point in the history
… screenreader was turned on. Resolves phonegap#40.
  • Loading branch information
dpa99c committed Jul 8, 2021
1 parent e982105 commit 66d2e7c
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -144,8 +144,11 @@ public void run() {
} catch(ClassCastException ce) { // cordova-android 4.0+
try { // cordova-android 4.0+
Method getView = webView.getClass().getMethod("getView");
Method reload = getView.invoke(webView).getClass().getMethod("reload");
reload.invoke(webView);
Object aView = getView.invoke(webView);
if (aView != null) {
Method reload = aView.getClass().getMethod("reload");
reload.invoke(aView);
}
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
Expand Down

0 comments on commit 66d2e7c

Please sign in to comment.