2011-10-13 70 views

回答

0
You are overriding the loading of all URLs by forcing the WebView to load them with this code 

    public boolean shouldOverrideUrlLoading(WebView view, String url) { 
     Log.i(TAG, "Loading..."); 
     view.loadUrl(url); 
     return true; 
    } 
The code would be something like.. 

Intent i = new Intent(Intent.ACTION_VIEW); 
i.setData(Uri.parse(url)); 
startActivity(i); 
0

其简单。

只需创建您的HTML字符串并使用webview.loadData(htmlString, "text/html", "utf-8");在webview中加载它。

欲了解更多信息,请参阅此Android doc for WebView

相关问题