You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting > Display > Display size. Then change display size.
Resume cordova app.
Then, App is crashed by fatal exception.
Process: com.myapp, PID: 18768
java.lang.IllegalArgumentException: View=DecorView@fb121f3[MainActivity] not attached to window manager
at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:497)
at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:406)
at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:138)
at android.app.Dialog.dismissDialog(Dialog.java:375)
at android.app.Dialog.dismiss(Dialog.java:358)
at org.apache.cordova.inappbrowser.InAppBrowser$5$1.onPageFinished(Unknown Source:18)
at xf.c(SourceFile:251)
at afs.handleMessage(SourceFile:72)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6813)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:522)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:889)
I think MainActivity have been destroyed and dialog is detacched when Display size is changed.
But InAppBrowser still have old dialog and try to dismiss() when app is resumed.
my-app\plugins\cordova-plugin-inappbrowser\src\android\InAppBrowser.java
public void closeDialog() {
this.cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
final WebView childView = inAppWebView;
// The JS protects against multiple calls, so this should happen only when
// closeDialog() is called by other native code.
if (childView == null) {
return;
}
childView.setWebViewClient(new WebViewClient() {
// NB: wait for about:blank before dismissing
public void onPageFinished(WebView view, String url) {
if (dialog != null) {
dialog.dismiss(); //!!!dialog is not attached to window
dialog = null;
}
}
});
This issue is not reproduced on Android O.
(onPageFinished is not called on Android O, So dialog.dismiss() is not called.)
The text was updated successfully, but these errors were encountered:
childView.setWebViewClient(newWebViewClient() {
// NB: wait for about:blank before dismissingpublicvoidonPageFinished(WebViewview, Stringurl) {
if (dialog != null && !cordova.getActivity().isFinishing()) {
dialog.dismiss();
dialog = null;
}
}
});
// NB: From SDK 19: "If you call methods on WebView from any thread// other than your app's UI thread, it can cause unexpected results."// http://developer.android.com/guide/webapps/migrating.html#ThreadschildView.loadUrl("about:blank");
Steps to reproduce:
Then, App is crashed by fatal exception.
I think MainActivity have been destroyed and dialog is detacched when Display size is changed.
But InAppBrowser still have old dialog and try to dismiss() when app is resumed.
my-app\plugins\cordova-plugin-inappbrowser\src\android\InAppBrowser.java
This issue is not reproduced on Android O.
(onPageFinished is not called on Android O, So dialog.dismiss() is not called.)
The text was updated successfully, but these errors were encountered: