Android GH-470 InAppBrowser: java.lang.IllegalArgumentException (#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 <sarafanov_v@firma-gamma.ru>
This commit is contained in:
parent
6c55e6172c
commit
e658c8c201
@ -313,7 +313,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (dialog != null) {
|
if (dialog != null && !cordova.getActivity().isFinishing()) {
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -326,7 +326,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
this.cordova.getActivity().runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (dialog != null) {
|
if (dialog != null && !cordova.getActivity().isFinishing()) {
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -537,7 +537,7 @@ public class InAppBrowser extends CordovaPlugin {
|
|||||||
childView.setWebViewClient(new WebViewClient() {
|
childView.setWebViewClient(new WebViewClient() {
|
||||||
// NB: wait for about:blank before dismissing
|
// NB: wait for about:blank before dismissing
|
||||||
public void onPageFinished(WebView view, String url) {
|
public void onPageFinished(WebView view, String url) {
|
||||||
if (dialog != null) {
|
if (dialog != null && !cordova.getActivity().isFinishing()) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
dialog = null;
|
dialog = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user