Open javascript window into AlertDialog

434 views Asked by At

In my app I've a webview displayed correctly. In the site there is a button that when clicked make a window.open() displaying some information. I've added a webchromeclient with the override of onCreateWindow method and add setSupportMultipleWindows(true) to the webview. It is called but I dont't how to display the content of the page into a dialog or how to show this page in a new window of the webview. Any suggestion?

1

There are 1 answers

0
Anasthase On

In your onCreateWindow() implementation, you need something like this:

WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;

// Create a new WebView here and display it to the user
newWebView = ...

transport.setWebView(newWebView);
resultMsg.sendToTarget();

return true;