需求:在webview中点击http连接,调用android默认的浏览器。这样在关闭url连接时,依然可以回到webview页面继续浏览
解决方案: 1、定义一个webview mwebview 2、在webView中加载url 3、设置webview参数: mwebview.getSettings().setJavaScriptEnabled(true); 其中:内部类中的方法openBrowser就是用来加载在webview中传来的url 4、在html 设置当点击http时,触发openBrowser函数。 <u><a onClick="window.openBrowser.openBrowser('http://www./main/wifibuy/')" style="color:#0000FF">http://www./main/wifibuy/</a></u> 其中:调用函数的方法:window.openBrowser.openBrowser(),参数要用单引号‘ |
|