这是代码
public static final String DATE_TIME_FORMAT = "yyyy-MM-dd kk:mm:ss";
public static final String KEY_DATE_TIME = "reminder_date_time";
SimpleDateFormat datetimeFormat = new SimpleDateFormat(DATE_TIME_FORMAT) ;
try {
String dateString = reminder.getString(reminder.getColumnIndexOrThrow(ReminderDbAdapter.KEY_DATE_TIME));
Date date = (Date) datetimeFormat.parse(reminder.getString(dateString);
mCalendar.setTime(date);
} catch (java.text.ParseException e) {
Log.e("edit_activity", e.getMessage(), e);
}
它没有解析日期,因为所有值都被提取但日期没有被解析,所以 logcat 显示错误。
error::06-11 14:08:59.320: E/edit_activity(361): java.text.ParseException: Unparseable date: 2012-03-11 13:14:49
请帮帮我