使用意图编辑日历事件不起作用

qkx*_*qkx 6 events android android-calendar

好的,我在这里非常准确地阅读了文档:http://developer.android.com/guide/topics/providers/calendar-provider.html#update-event,其编写如下:

// Here is an example of an intent that sets a new title for a specified event and lets users edit the event in the Calendar.

long eventID = 208;
Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
Intent intent = new Intent(Intent.ACTION_EDIT)
    .setData(uri)
    .putExtra(Events.TITLE, "My New Title");
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)

对我来说它不起作用 - 它打开了正确的事件,但编辑它是不可能的 - 所有字段都是只读的.只有我可以更改的字段是Timezone和Reminder.其他一切都是只读的.难道我做错了什么?

我的API等级是14(ICS)

JRa*_*ond 6

所以我不认为你做错了什么 - 我通过命令行把同一件事的基本实现放在一起,同样的限制适用:

am start -a android.intent.action.EDIT --es title "New Title" content://com.android.calendar/events/1
Run Code Online (Sandbox Code Playgroud)

我只能编辑你自己的相同字段 - 你可能最好做一个ACTION_VIEW并让用户决定编辑(抱歉,我没有更好的答案,这有点烦人)

  • 请为此错误投票:http://code.google.com/p/android/issues/detail?id = 39402 (4认同)