I can't find any Google documentaion for the Calendar or the Intents
it supports.  So unless you can provide a reference I guess you are
using unsupported features.

On Aug 4, 10:36 am, Thomas Frick <frick...@gmail.com> wrote:
> Dear all,
>
> I'm trying to add an event to the calendar and it works very well. But
> if I try to add a remeinder with an alert I receive the following
> error message:
>
> 08-04 11:24:56.193: ERROR/DatabaseUtils(2094): Error inserting state=0
> event_id=113 minutes=10 end=1753609766 alarmTime=1753609764
> begin=1753609764 into table  CalendarAlerts
> 08-04 11:24:56.193: ERROR/DatabaseUtils(2094):
> android.database.sqlite.SQLiteConstraintException: error code 19:
> constraint failed
> 08-04 11:24:56.193: ERROR/DatabaseUtils(2094):     at
> android.database.sqlite.SQLiteStatement.native_execute(Native Method)
> 08-04 11:24:56.193: ERROR/DatabaseUtils(2094):     at
> android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:
> 96)
> 08-04 11:24:56.193: ERROR/DatabaseUtils(2094):     at
> android.database.DatabaseUtils
> $InsertHelper.insertInternal(DatabaseUtils.java:794)
> 08-04 11:24:56.193: ERROR/DatabaseUtils(2094):     at
> android.database.DatabaseUtils$InsertHelper.insert(DatabaseUtils.java:
> 915)
> 08-04 11:24:56.193: ERROR/DatabaseUtils(2094):     at
> com.android.providers.calendar.CalendarProvider.insertInternal(CalendarProvider.java:
> 2425)
> 08-04 11:24:56.193: ERROR/DatabaseUtils(2094):     at
> android.content.AbstractSyncableContentProvider.insert(AbstractSyncableContentProvider.java:
> 358)
> 08-04 11:24:56.193: ERROR/DatabaseUtils(2094):     at
> android.content.ContentProvider$Transport.insert(ContentProvider.java:
> 150)
> 08-04 11:24:56.193: ERROR/DatabaseUtils(2094):     at
> android.content.ContentProviderNative.onTransact(ContentProviderNative.java:
> 140)
> 08-04 11:24:56.193: ERROR/DatabaseUtils(2094):     at
> android.os.Binder.execTransact(Binder.java:287)
> 08-04 11:24:56.193: ERROR/DatabaseUtils(2094):     at
> dalvik.system.NativeStart.run(Native Method)
>
> The code of the methode to insert the remeinder is:
>
> final ContentResolver cr = this.getContentResolver();
>
> if(newEvent != null)
>         {
>                 long id = Long.parseLong(newEvent.getLastPathSegment());
>                 long reminderMinutes = 10;
>                 int starttime = (int) startdate;
>
>                 ContentValues values = new ContentValues();
>                 values.put("event_id", id);
>                 values.put("method", 1);
>                 values.put("minutes", reminderMinutes);
>                 cr.insert(Uri.parse("content://calendar/reminders"), values);
>
>                 values = new ContentValues();
>                 values.put("event_id", id );
>                 values.put("begin", starttime);
>                 values.put("end", starttime+2);
>                 values.put("alarmTime", starttime);
>                 values.put("state", 0);
>                 values.put("minutes", reminderMinutes);
>                 cr.insert(Uri.parse("content://calendar/calendar_alerts"),
> values);
>         }
>
> Thanks in advance for your help.
>
> Best regards,
> Thomas

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to