0
我putExtras的getSerializableExtra日历中的活动答:我不能恢复使用意向
notificationIntent.putExtra(KEY_ID, id);
notificationIntent.putExtra(KEY_CALENDAR, day);
A.logCalendar("calendar: ", day); // the Calendar is not null at this point
我getExtras EN活动B:
int id = intent.getIntExtra(Constantes.KEY_ID, 0);
A.b("My id: " + id); // The id is recovery
Calendar time = (Calendar) intent.getSerializableExtra(Constantes.KEY_CALENDAR);
if (time == null)
A.b("null calendar"); // The calendar is always null, WHY?
我在做什么错。提前致谢。
你为什么要那样做?只需在每个活动中创建一个日历。 'Calendar'只是日期和时间计算的帮手。如果你想传递一个时间点,使用'java.util.Date'类或毫秒作为'long'。 – Stephan 2012-04-20 15:16:42
有时我们离树很近,以至于看不到森林。谢谢。我会用很长的毫秒。 – Jesus 2012-04-20 19:17:31