java如何从我的安卓应用程序中删除或编辑Gcalendar中的事件?
我正在获取谷歌日历事件列表
我可以获得哪个事件标识符来删除和编辑特定事件
以下是我的抓取代码:
private void fetchEvents() {
String[] selection = new String[] { "calendar_id", "title", "description",
"dtstart", "dtend", "eventLocation" };
String projection = "description LIKE ?";
String[] selecionArgs = new String[]{"%/images/%"};
String orderby = "dtstart ASC";
Cursor cursor = getContentResolver()
.query(
Uri.parse("content://com.安卓.calendar/events"),
selection, projection,
selecionArgs, orderby);
cursor.moveToFirst();
// fetching calendars name
String CNames[] = new String[cursor.getCount()];
for (int i = 0; i < CNames.length; i++) {
nameOfEvent.add(cursor.getString(1));
cursor.moveToNext();
}
}
这里我想删除一个事件(顺便问一下,我应该使用哪种类型进行编辑?)
private void deleteCalendarEvent_intent() {
Intent intent = new Intent(Intent.ACTION_DELETE)
//?
startActivity(intent);
}
共 (0) 个答案