我正在从网站上加载Rss新闻。我住在希腊,但我的设备语言是英国英语。当手机使用英语时,新闻正在加载,但是当我将其更改为希腊语时,我从我的代码中获取了捕获信息,它会弹出一个吐司来打开我的wifi连接,但我的连接始终打开....
我也尝试过我的女朋友Android设备,并且存在同样的问题...我想显示rss新闻,甚至设备语言是希腊语,英语或法语。你知道如何解决这个代码,所以我可以做到这一点吗?
private void loadFeed(){
try{
BaseFeedParser2 parser = new BaseFeedParser2();
messages = parser.parse();
//List<String> descriptions = new ArrayList<String>();
ArrayList<HashMap<String, String>> List = new ArrayList<HashMap<String, String>>(messages.size());
for (Message msg : messages){
HashMap<String, String> map = new HashMap<String, String>();
map.put("name", msg.getTitle());
map.put("date", msg.getDate());
List.add(map);
ListAdapter mSchedule = new SimpleAdapter(this, List, R.layout.row_nea,
new String[] {"name", "date"}, new int[] {R.id.TextView01, R.id.TextView02});
this.setListAdapter(mSchedule);
}}
catch (Throwable t){
Log.e("OSFP.News",t.getMessage(),t);
Toast.makeText(polo_antrwn.this, "Χρειάζεστε σύνδεση στο internet",
Toast.LENGTH_SHORT).show();
finish();
}
}
修改
logcat的
06-02 13:52:49.383: ERROR/OSFP.News(6809): java.lang.RuntimeException: java.text.ParseException: Unparseable date: Thu, 02 Jun 2011 03:50:39 PDT00
06-02 13:52:49.383: ERROR/OSFP.News(6809): java.lang.RuntimeException: java.lang.RuntimeException: java.text.ParseException: Unparseable date: Thu, 02 Jun 2011 03:50:39 PDT00
06-02 13:52:49.383: ERROR/OSFP.News(6809): at kostas.menu.olympiakos.DomFeedParser.parse(DomFeedParser.java:54)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at kostas.menu.olympiakos.nea.loadFeed(nea.java:51)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at kostas.menu.olympiakos.nea.onCreate(nea.java:41)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at android.os.Handler.dispatchMessage(Handler.java:99)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at android.os.Looper.loop(Looper.java:123)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at android.app.ActivityThread.main(ActivityThread.java:4627)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at java.lang.reflect.Method.invokeNative(Native Method)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at java.lang.reflect.Method.invoke(Method.java:521)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at dalvik.system.NativeStart.main(Native Method)
06-02 13:52:49.383: ERROR/OSFP.News(6809): Caused by: java.lang.RuntimeException: java.text.ParseException: Unparseable date: Thu, 02 Jun 2011 03:50:39 PDT00
06-02 13:52:49.383: ERROR/OSFP.News(6809): at kostas.menu.olympiakos.Message.setDate(Message.java:57)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at kostas.menu.olympiakos.DomFeedParser.parse(DomFeedParser.java:48)
06-02 13:52:49.383: ERROR/OSFP.News(6809): ... 15 more
06-02 13:52:49.383: ERROR/OSFP.News(6809): Caused by: java.text.ParseException: Unparseable date: Thu, 02 Jun 2011 03:50:39 PDT00
06-02 13:52:49.383: ERROR/OSFP.News(6809): at java.text.DateFormat.parse(DateFormat.java:645)
06-02 13:52:49.383: ERROR/OSFP.News(6809): at kostas.menu.olympiakos.Message.setDate(Message.java:55)
06-02 13:52:49.383: ERROR/OSFP.News(6809): ... 16 more