开发者

How to load hyper link tag in webview

can anybody tell 开发者_开发技巧how to load hyper link tag in webview

Thanks


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);


Its Simple.

Just create your HTML string and load it inside the webview using webview.loadData(htmlString, "text/html", "utf-8");.

For more information, refer this Android doc for WebView.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜