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.
精彩评论