Android和QUOT;在__ms加载时区名称为EN&QUOT。 [英] Android "Loaded time zone names for en in __ms."

查看:171
本文介绍了Android和QUOT;在__ms加载时区名称为EN&QUOT。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写的应用程序加载使用 HorrorRSS库一个RSS feed 。我现在面临的问题是,在看我看到这个垃圾巨量日志:

The app I'm writing loads an RSS feed using the HorrorRSS library. The problem I'm facing is that looking at the logs I see oodles of this junk:

10-06 12:58:36.939: I/global(3159): Loaded time zone names for en in 624ms.
10-06 12:58:37.329: I/global(3159): Loaded time zone names for en in 368ms.
10-06 12:58:37.709: I/global(3159): Loaded time zone names for en in 370ms.
10-06 12:58:38.149: I/global(3159): Loaded time zone names for en in 403ms.
10-06 12:58:38.589: I/global(3159): Loaded time zone names for en in 420ms.
10-06 12:58:39.039: I/global(3159): Loaded time zone names for en in 446ms.
10-06 12:58:39.449: I/global(3159): Loaded time zone names for en in 393ms.
10-06 12:58:39.859: I/global(3159): Loaded time zone names for en in 396ms.
10-06 12:58:40.269: I/global(3159): Loaded time zone names for en in 401ms.
10-06 12:58:40.749: I/global(3159): Loaded time zone names for en in 459ms.
10-06 12:58:41.159: I/global(3159): Loaded time zone names for en in 404ms.
10-06 12:58:41.549: I/global(3159): Loaded time zone names for en in 380ms.
10-06 12:58:41.919: I/global(3159): Loaded time zone names for en in 366ms.
10-06 12:58:42.289: I/global(3159): Loaded time zone names for en in 363ms.
10-06 12:58:42.659: I/global(3159): Loaded time zone names for en in 368ms.
10-06 12:58:43.109: I/global(3159): Loaded time zone names for en in 437ms.
10-06 12:58:43.489: I/global(3159): Loaded time zone names for en in 377ms.
10-06 12:58:43.879: I/global(3159): Loaded time zone names for en in 387ms.
10-06 12:58:44.279: I/global(3159): Loaded time zone names for en in 387ms.
10-06 12:58:44.649: I/global(3159): Loaded time zone names for en in 367ms.
10-06 12:58:45.029: I/global(3159): Loaded time zone names for en in 379ms.
10-06 12:58:45.469: I/global(3159): Loaded time zone names for en in 438ms.

我认识到,没有与的SimpleDateFormat 类的问题作为的这个问题,它看起来像<一个href=\"http://$c$c.google.com/p/horrorss/source/browse/trunk/src/org/horrabin/horrorss/RssParser.java#600\"相对=nofollow> RssParser.getDate()函数使用它来提取RSS提要的日期。

I realize that there is an issue with the SimpleDateFormat class as described in this question, and it looks like the RssParser.getDate() function uses it to extract the date from the RSS feed.

这些语句似乎发生后的权利我加载饲料,即:

These statements seem to happen right after I load the feed, i.e.:

RssParser rss = new RssParser();
RssFeed feed = rss.load("some feed url");
// This is where the log statements begin appearing.

我能理解为什么他们会被记录一次,在第一次调用的SimpleDateFormat 。但没有人知道为什么这些语句被记录一遍又一遍,我怎么能prevent呢?他们正在做我的应用程序无法为一半的Andr​​oid系统认为它太耗费资源,并杀死它之前,UI甚至加载时运行。

I can understand why they would be logged once, on the first call to SimpleDateFormat. But does anyone know why these statements are being logged over and over again, and how I can prevent them? They're making my app impossible to run as half the time the Android system deems it too resource intensive and kills it before the UI is even loaded.

如果在时区名称是仅在第一次调用的SimpleDateFormat 加载一次那么这将是完全可以接受的。但是的每一次的我加载一个RSS feed我收到几十这些日志。有没有办法打开缓存或东西??

If the time zone names were only loaded once on the first call to SimpleDateFormat then it would be perfectly acceptable. But every single time I load an RSS feed I get dozens of these logs. Is there a way to turn the cache on or something??

任何帮助将大大AP preciated。我在水中基本死定了,直到我可以算出来。

Any help would be greatly appreciated. I'm basically dead in the water till I can figure this out.

更新:我已经提交了一个问题给HorrorRSS项目,使他们RssParser.getDate()方法保护或公开。然后,我将能够提供我自己的实现,使用类似于JodaTime。我认为这会工作。有什么想法?

Update: I have submitted an issue to the HorrorRSS project to make their RssParser.getDate() method protected or public. Then, I will be able to provide my own implementation that uses something like JodaTime. I think this will work. Any thoughts?

推荐答案

我结束了导入HorroRSS源代码树放到矿井和修改 RssParser 类,以便 RssParser.getDate()是受保护的。然后,我添加了覆盖我自己的 RssParser RssParser.getDate()用我自己的 DateParser 使用JodaTime工具类:

I ended up importing the HorroRSS source tree into mine and modifying the RssParser class so that RssParser.getDate() is protected. I then added my ownRssParser subclass which overrides RssParser.getDate() using my own DateParser utility class that uses JodaTime:

@Override    
protected Date getDate(String dateString, int rssType)
{
     return DateParser.getDate(dateString, rssType);
}

HorroRSS的维护者是要修改 RssParser 来接受一个自定义日期解析器的实现,因此在未来没有厂商code的修改是必要的。我的修改只是一个权宜之计,直到那时。

The maintainer of HorroRSS is going to modify RssParser to accept a custom date parser implementation, so in the future no modification of vendor code is necessary. My modifications are merely a stop-gap till then.

这篇关于Android和QUOT;在__ms加载时区名称为EN&QUOT。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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