I have strange issue, I don’t know how to resolve this. I have tested many things but dont know what the problem.
Ok I have create simple program to Insert event into google calendar device this will inserted into google calendar successfully.
When I am trying to editing from google calendar or click on edit menu google calendar will be crashed. I have testing in many devices the problem was same for all the device calendar.
here is my code
ContentResolver cr = getContentResolver();
ContentValues values = new ContentValues();
Uri EVENTS_URI = null;
EVENTS_URI = Uri.parse("content://com.android.calendar/events");
long time = System.currentTimeMillis();
values.put("calendar_id", 1);
values.put("title", "event.eventName");
values.put("allDay", 0);
values.put("dtstart", time);
values.put("dtend", time + 1000 * 60 * 60 * 2);
values.put("description", "description");
values.put("visibility", 0);
values.put("transparency", 0);
values.put("hasAttendeeData", 0);
values.put("hasAlarm", 1);
values.put("eventLocation", "location");
cr.insert(EVENTS_URI, values);
I am not able to detecting or reason that why this happen in my inserted event only
After analysis for inserting event and searching the logcat for calendar I have found that my calendar was force close when I am trying to edit the event which was inserted from my application.
The reason is I have not set the TimeZone field value for my event and in calendar it will get as null pointer at editing time that’s why it gone to force close
I have also search for logcat application for android I found this
https://play.google.com/store/apps/details?id=org.jtb.alogcat&feature=search_result
to detect all the log its very useful to me from that log I know that TimeZone filled value null and calendar application gone to crashed.
so I just add this filled value at inserting time and it’s work perfectly.
for ICS
below ICS