在AlertDialog中打开javascript窗口

问题描述:

在我的应用程序中,我的webview显示正确。 在该网站有一个按钮,当点击时使window.open()显示一些信息。 我已经添加了一个带有onCreateWindow方法覆盖的webchromeclient,并向webview添加了setSupportMultipleWindows(true)。 它被称为,但我不会如何显示页面的内容到一个对话框或如何显示在web视图的新窗口中的此页面。 有什么建议吗?在AlertDialog中打开javascript窗口

在你onCreateWindow()实现,你需要的东西是这样的:

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;