Java 如何删除谷歌日历事件?
我写了一个android应用程序来获取我的事件 如何识别事件(某些唯一ID) 然后删除它还是编辑它Java 如何删除谷歌日历事件?,java,android,google-calendar-api,Java,Android,Google Calendar Api,我写了一个android应用程序来获取我的事件 如何识别事件(某些唯一ID) 然后删除它还是编辑它 private void fetchEvents() { String[] selection = new String[] { "calendar_id", "title", "description", "dtstart", "dtend", "eventLocation" }; String projection = "description LIK
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.android.calendar/events"),
selection, projection,
selecionArgs, orderby);
cursor.moveToFirst();
// fetching calendars name
String CNames[] = new String[cursor.getCount()];
// fetching calendars id
nameOfEvent.clear();
startDates.clear();
endDates.clear();
descriptions.clear();
for (int i = 0; i < CNames.length; i++) {
nameOfEvent.add(cursor.getString(1));
startDates.add(new Date(Long.parseLong(cursor.getString(3))));
//endDates.add(new Date(Long.parseLong(cursor.getString(4))));
String fullDescription = cursor.getString(2);
int firstIndex = fullDescription.indexOf("localUri: ");
firstIndex = (firstIndex < 0)? 0 : 10;
int lastIndex = fullDescription.indexOf("\n");
lastIndex = (lastIndex < 0)? fullDescription.length() : lastIndex;
descriptions.add(fullDescription.substring(firstIndex, lastIndex));
CNames[i] = cursor.getString(1);
cursor.moveToNext();
}
}
private void fetchEvents(){
字符串[]选择=新字符串[]{“日历id”、“标题”、“说明”,
“dtstart”、“dtend”、“eventLocation”};
String projection=“description LIKE?”;
字符串[]selecionArgs=新字符串[]{“%/images/%”;
字符串orderby=“dtstart ASC”;
Cursor Cursor=getContentResolver()
.查询(
解析content://com.android.calendar/events"),
选择,投射,,
selecionArgs,订购人);
cursor.moveToFirst();
//获取日历名称
字符串CNames[]=新字符串[cursor.getCount()];
//获取日历id
name of event.clear();
开始日期。清除();
endDates.clear();
descriptions.clear();
对于(int i=0;i
为什么这个标签是谷歌应用程序引擎
?还以为是谷歌客户端API呢