2011-10-13 28 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

相關問題