I think the problem may be with this line:

>                 java.text.DateFormat dateFormat
> =android.text.format.DateFormat.getDateFormat(context);

This will get the format according to the current locale, which may
not be mm/dd/yyyy and from what I see here doesn't even seem to
contain any '/' characters.  That is why you are getting an array
length of 1 from the .split("/") call.

Here is the warning from Android web site on this exact issue:
http://developer.android.com/reference/java/util/Locale.html#default_locale

Instead, construct the date format you were expecting to parse using
SimpleDateFormat.  For example:

                java.text.DateFormat dateFormat = new
SimpleDateFormat("MM/dd/yyyy");

This should work better if you force the format to be what you were
expecting to parse.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to