java - Weird parsing date string error in Android 2.0 emulator -


I have a simple test code to test SimpleDateFormat. This code works well on Eclipse and Android 1.5 emulator. Does, but it failed on the Android 2.0 emulator. Does anyone know why? Thank you.

  The public class extends the template activity activity {/ ** is called when the activity has been created previously * / @ Override Crate (bundled saved instainstate) {super. Contents (Saved Instantstate); TextView TV = new textview (this); Tv.setText (R.string.hello); SetContentView (TV); Simple Format Format = New SimpleDormat ("EEE, DD MMM YH H: MM: SS Jays"); String Date Str = "Mon, 17 May 2010 01:45:41 GMT"; Try {date parseed = format.parse (dateStr); Logs. V ("Test", Parsed.trusting ()); } Hold (ParseException pe) {log. V ("test", "error: can not parse" "+ + date + +" \ ""); }}}  

log message:

  V / test (400): error: can not parse "Mon, 17 May 2010 01:45: In response to 41 GMT Screeds,  

I tried "EEE, DD MMM yyyy HH: mm: ss z", but got the same error message.

I also tried

  SimpleDateFormat format = new SimpleDateFormat ("EEE, dd MMM Yyyy HH: mm: SS zzz", locale.US);  

This works But for the time being, it takes long time for the system to load the time zone names for en_US Is:

  I / Resource (471): Name of the time zone loaded for en_US in 1904ms. D / DelWikam (471): GC has 8865 Ist / IIM / 486232 bytes free I / Resources (471): Loaded time zone name for NOS in 1400 ms / resource (471): Time zone name loaded for NOUS in 1260 ms D / Dellvikam (471): GC 10615 Objects / 491920 bytes in 91 ms I / Resources (471): Time zone name loaded for NOS in 1360 ms / resource (471): N Name of the time zone loaded in the OUS 1232 ms. D / DelWikm (471): GC has 10623 items / 460544 bytes in 91 ms. I / Resource (471): Name of the time zone loaded for NOUS in 1344 ms. I / Resource (471): Name of time zone loaded for N_US in 1228ms  

What should I do?


Comments