Skip to content Skip to sidebar Skip to footer

Crash Occur While Running App In Ice Cream Sandwich

I have created an app that stores events in the device calendar, and it works. But when I try to do the same thing in ICE CREAM SANDWICH it crashes the app. Why does this happen?

Solution 1:

I also meet this problem and now I solve it. The code you want to work fine above ICE CREAM SANDWICH ,you need to set the values of eventTimezone. Well , just need to add the code like

ContentValues values=new ContentValues();
values.put("calendar_id", 1);
values.put("title", str);
values.put("description", m_strDescription);                    
values.put("dtstart", cal.getTimeInMillis()); 
values.put("dtend", cal.getTimeInMillis()); 
values.put("hasAlarm", 1);

values.put(Events.EVENT_TIMEZONE, TimeZone.getDefault().getID());  //add this row

Uri event = cr.insert(EVENTS_URI, values);

Solution 2:

alextsc is correct. You're using undocumented APIs here, which are unsupported and broken for Ice Cream Sandwich. Read that blog post he linked to, and then look into using the CalendarContract API to make Ice Cream Sandwich work for you.

Post a Comment for "Crash Occur While Running App In Ice Cream Sandwich"