Note that there are some explanatory texts on larger screens.

plurals
  1. POCrash Occur while running app in ICE CREAM SANDWICH
    primarykey
    data
    text
    <p>Actually i have created an app which stored event in device calendar, and its works fine and stored event in the device calendar. But when i try to do the same thing in ICE CREAM SANDWICH it crashes the app why this happen. Can anyone help me to solve this out. The code i have used to save events in device calendar shown below, and the log cat for the crash is also there.</p> <p><strong>Code for saving events to device calendar</strong></p> <pre><code>public boolean setAlertOnDevice(Context c) { Resources res = c.getResources(); Uri EVENTS_URI = Uri.parse("content://com.android.calendar/" + "events"); Uri REMINDERS_URI = Uri.parse("content://com.android.calendar/" + "reminders"); ContentResolver cr = c.getContentResolver(); Date dtStartDate = getStartDate(); Calendar cal = Calendar.getInstance(); cal.setTime(dtStartDate); cal.add(Calendar.DATE, m_iStart); cal.set(Calendar.HOUR_OF_DAY, 8); cal.set(Calendar.MINUTE, DEFAULT_TIME_OF_DATE); cal.set(Calendar.SECOND, DEFAULT_TIME_OF_DATE); cal.set(Calendar.MILLISECOND, DEFAULT_TIME_OF_DATE); String str = m_reminderText + res.getString(R.string.alert_start); m_strDescription = res.getString(R.string.alert_start_msg); 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); Uri event = cr.insert(EVENTS_URI, values); m_calendarEvents[m_calendarEventCount] = event; m_calendarEventCount = m_calendarEventCount + 1; values = new ContentValues(); values.put("event_id", Long.parseLong(event.getLastPathSegment())); values.put("method", 1); values.put("minutes", 10); cr.insert(REMINDERS_URI, values); } </code></pre> <p><strong>Log cat reports</strong></p> <pre><code>03-02 18:28:35.836: E/AndroidRuntime(1362): FATAL EXCEPTION: main 03-02 18:28:35.836: E/AndroidRuntime(1362): java.lang.RuntimeException: Unable to pause activity {in.plackal.lovecyclesfree/in.plackal.lovecyclesfree.ActivityManager}: java.lang.IllegalArgumentException: Event values must include an eventTimezone 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2706) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2662) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2640) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.app.ActivityThread.access$800(ActivityThread.java:123) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.os.Handler.dispatchMessage(Handler.java:99) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.os.Looper.loop(Looper.java:137) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.app.ActivityThread.main(ActivityThread.java:4424) 03-02 18:28:35.836: E/AndroidRuntime(1362): at java.lang.reflect.Method.invokeNative(Native Method) 03-02 18:28:35.836: E/AndroidRuntime(1362): at java.lang.reflect.Method.invoke(Method.java:511) 03-02 18:28:35.836: E/AndroidRuntime(1362): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 03-02 18:28:35.836: E/AndroidRuntime(1362): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 03-02 18:28:35.836: E/AndroidRuntime(1362): at dalvik.system.NativeStart.main(Native Method) 03-02 18:28:35.836: E/AndroidRuntime(1362): Caused by: java.lang.IllegalArgumentException: Event values must include an eventTimezone 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:165) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.content.ContentProviderProxy.insert(ContentProviderNative.java:415) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.content.ContentResolver.insert(ContentResolver.java:730) 03-02 18:28:35.836: E/AndroidRuntime(1362): at in.plackal.lovecyclesfree.CycleManager.setAlertOnDevice(CycleManager.java:1083) 03-02 18:28:35.836: E/AndroidRuntime(1362): at in.plackal.lovecyclesfree.ActivityManager.onPause(ActivityManager.java:83) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.app.Activity.performPause(Activity.java:4563) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1195) 03-02 18:28:35.836: E/AndroidRuntime(1362): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2693) 03-02 18:28:35.836: E/AndroidRuntime(1362): ... 12 more </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload