Skip to content

Commit e658c8c

Browse files
SlayterikSarafanov Valeriy
andauthored
Android apacheGH-470 InAppBrowser: java.lang.IllegalArgumentException (apache#616)
Fix interacting with views when Activity destroyed Bug description https://stackoverflow.com/questions/22924825/view-not-attached-to-window-manager-crash Co-authored-by: Sarafanov Valeriy <[email protected]>
1 parent 6c55e61 commit e658c8c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/android/InAppBrowser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ else if (action.equals("show")) {
313313
this.cordova.getActivity().runOnUiThread(new Runnable() {
314314
@Override
315315
public void run() {
316-
if (dialog != null) {
316+
if (dialog != null && !cordova.getActivity().isFinishing()) {
317317
dialog.show();
318318
}
319319
}
@@ -326,7 +326,7 @@ else if (action.equals("hide")) {
326326
this.cordova.getActivity().runOnUiThread(new Runnable() {
327327
@Override
328328
public void run() {
329-
if (dialog != null) {
329+
if (dialog != null && !cordova.getActivity().isFinishing()) {
330330
dialog.hide();
331331
}
332332
}
@@ -537,7 +537,7 @@ public void run() {
537537
childView.setWebViewClient(new WebViewClient() {
538538
// NB: wait for about:blank before dismissing
539539
public void onPageFinished(WebView view, String url) {
540-
if (dialog != null) {
540+
if (dialog != null && !cordova.getActivity().isFinishing()) {
541541
dialog.dismiss();
542542
dialog = null;
543543
}

0 commit comments

Comments
 (0)