CB-4586: Making loadUrl run on the UI thread for close dialog to stop the WebView error

This commit is contained in:
Joe Bowser 2013-08-28 14:20:01 -07:00
parent be364c081d
commit 8b52796a89

View File

@ -313,7 +313,17 @@ public class InAppBrowser extends CordovaPlugin {
*/
private void closeDialog() {
try {
this.inAppWebView.loadUrl("about:blank");
final WebView childView = this.inAppWebView;
Runnable runnable = new Runnable() {
@Override
public void run() {
childView.loadUrl("about:blank");
}
};
this.cordova.getActivity().runOnUiThread(runnable);
JSONObject obj = new JSONObject();
obj.put("type", EXIT_EVENT);