开发者

My Web View in android only showing the html Code can Any suggest me what to do to see the Real Web page

My Web View in android only showing the html Code can Any suggest me what to do to see the Real Web page..

My Code is Here

WebView) findViewById(R.id.webview);
    mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("http://news.yahoo.com/rss/");
   // mWebView.setWebViewClient(new HelloWebViewClient()); 

Uri uri = Uri.parse("http://news.yahoo.com/rss/");
mWebView.loadData("http://news.yahoo.com/rss","TEXT/HTML", "UTF-8");
Intent intent = new  Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);

private  class  HelloWebViewClient  extends  WebViewClient {
    @Override
    public  boolean  shouldOverrideUrlLoading(WebVi开发者_如何学编程ew view, String url) {
        view.loadUrl(url);
        view.getBackground();
        return  true;
    }
}


the address gives only access to the RSS feed of yahoo news.

Rss is in fact an XML file with no style information: http://wikipedia.org/wiki/RSS

The best way to do it is to download the xml file, parse it and display it with Textviews..

To parse it you can use Saxx parser.

This page should help you: http://www.ibm.com/developerworks/xml/tutorials/x-androidrss/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜