나는 Android 캘린더에서 모든 항목을 삭제하는 간단한 코드를 작성했지만 아무 것도 삭제하지 않았습니다.캘린더 항목 삭제
소스 코드 :
public void DeleteEvent(View view){
int iNumRowsDeleted = 0;
Uri eventsUri = Uri.parse("content://com.android.calendar/events");
Cursor cur = getContentResolver().query(eventsUri, null, null, null, null);
while (cur.moveToNext()){
long id = cur.getLong(cur.getColumnIndex("_id"));
Log.d(TAG, "ID: " + id);
Uri eventUri = ContentUris.withAppendedId(eventsUri, id);
iNumRowsDeleted = getContentResolver().delete(eventUri, null, null);
}
}
고마워요. @Husky .. 저에게 맞습니다. –