Я пытаюсь обновить SELF_ATTENDEES_STATUS в таблице событий следующим образом:
private void UpdateCalendarEntry(int position, boolean isAccepted) {
ContentResolver cr = mContext.getContentResolver();
Uri updateUri = ContentUris.withAppendedId(CalendarContract.Events.CONTENT_URI, getEventId(mEvents.get(position).getTitle()));
ContentValues values = new ContentValues();
if(isAccepted) {
values.put(CalendarContract.Events.SELF_ATTENDEE_STATUS, CalendarContract.Attendees.ATTENDEE_STATUS_ACCEPTED);
} else {
values.put(CalendarContract.Events.SELF_ATTENDEE_STATUS, CalendarContract.Attendees.ATTENDEE_STATUS_DECLINED);
}
cr.update(updateUri, values, null, null);
}
Но, к сожалению, я получаю этот стек ошибок
java.lang.IllegalArgumentException: Updating selfAttendeeStatus in Events table is not allowed.
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:165)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
at android.content.ContentProviderProxy.update(ContentProviderNative.java:572)
at android.content.ContentResolver.update(ContentResolver.java:1720)
at com.jmjsolution.solarup.adapters.EventAdapter$EventViewHodler.UpdateCalendarEntry(EventAdapter.java:346)
at com.jmjsolution.solarup.adapters.EventAdapter$EventViewHodler.access$600(EventAdapter.java:91)
at com.jmjsolution.solarup.adapters.EventAdapter$EventViewHodler$2$1.onClick(EventAdapter.java:227)
at android.view.View.performClick(View.java:6597)
at android.view.View.performClickInternal(View.java:6574)
at android.view.View.access$3100(View.java:778)
at android.view.View$PerformClick.run(View.java:25885)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Кто-то знает, как обновитьэто поле пожалуйста?Спасибо.