我使用以下方法在本地删除谷歌日历上的所有事件(ICS和JB):
public void deleteAll(){
String selection = "(" + CalendarContract.Events.CALENDAR_ID + " = ?)";
String[] selectionArgs = new String[] { Integer.toString(this.calId) };
ContentResolver cr = context.getContentResolver();
int rows = cr.delete(CalendarContract.Events.CONTENT_URI, selection, selectionArgs);
Log.d(TAG, rows + " events deleted");
}
Run Code Online (Sandbox Code Playgroud)
一切正常,但我收到一个恼人的警告:删除太多日历
Delete limit exceeded
There are 21 deleted items for Calendar, account
xxxxx.xxxxx@gmail.com. What would you like to do?"
Delete the items.
Undo the deletes.
Do nothing for now.
Run Code Online (Sandbox Code Playgroud)
错误显示的原因是什么,有没有人知道避免错误的方法?我正在使用HTC One-X
关心R.