我如何显示的WebView的全功能HTML从FeedBurner的内容? [英] How do I display content from feedburner in WebView in Full HTML?

查看:130
本文介绍了我如何显示的WebView的全功能HTML从FeedBurner的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是的WebView 来显示此 FeedBurner的。当我在谷歌浏览器,并在设备的浏览器查看这个链接它显示标题,摘要,链接,最重要的播客文件和其他超链接。然而,当我查看我的的WebView此链接那只能说明它在纯文本HTML,没有超链接。我看到的是一个标题和故事片段,其次是HTML源代码code。是否有一个特别是必须能够解决此问题?

这是我的的WebView 设置:

 新闻源=(的WebView)findViewById(R.id.webViewnews);
newsfeed.getSettings()setJavaScriptEnabled(真)。
newsfeed.setVerticalScrollBarEnabled(假);
newsfeed.getSettings()setPluginsEnabled(真)。

我如何加载的网址:

  {尝试
    newsfeed.loadUrl(http://feeds.feedburner.com/fsn);
}赶上(例外五){
    e.printStackTrace();
}


我看到你所看到的,与标题条目后对股票浏览器文章内容的HTML列表 - 摩托罗拉Droid运行2.2.3。我的猜测是,这是该网站为股票的Andr​​oid的WebView用户代理提供的格式。谷歌Chrome是不是股票浏览器自带的Andr​​oid开源项目,并做更多的发动机罩下呈现内容。

我先试试不同的用户代理,看看web视图将呈现内容。请注意,他们可能会使用不与Android这就是为什么你看到的'简化'的内容以及工作的各种JavaScript库。

I am using a WebView to display this feedburner. When I view this link in Google Chrome and in the device's browser it shows the title, snippet, links, and most importantly a podcast file and other hyperlinks. However, when I view this link in my WebView it only shows it in Plain Text HTML with no hyperlinks. All i see is a title and the story snippet, followed by HTML source code. Is there a particular that must be enabled to resolve this?

These are my WebView settings:

newsfeed = (WebView) findViewById(R.id.webViewnews);
newsfeed.getSettings().setJavaScriptEnabled(true);
newsfeed.setVerticalScrollBarEnabled(false);
newsfeed.getSettings().setPluginsEnabled(true);

How I load the URL:

try {
    newsfeed.loadUrl("http://feeds.feedburner.com/fsn");
} catch (Exception e) {
    e.printStackTrace();
}

解决方案

I'm seeing what you are seeing, list of entries with Title followed by html of article content on the Stock Browser - Motorola Droid running 2.2.3. My guess is that this is the format that the site provided for the stock Android WebView User Agent. Google Chrome is NOT the stock browser that comes with Android Open Source Project and does more under the hood to render content.

I would try a different user agent first to see if the webview will render the content. Note that they may be using various Javascript libraries which don't work well with Android which is why you are seeing the 'simplified' content.

这篇关于我如何显示的WebView的全功能HTML从FeedBurner的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆