How to read and edit Android calendar events using the new Android 4.0 Ice Cream Sandwich API?

前端 未结 6 2159
醉梦人生
醉梦人生 2020-11-28 22:13

We are trying to show user the Ice cream Sandwich calendar view, when they want to add a new event. We can only test this in emulator.

The other problem is that we c

6条回答
  •  旧巷少年郎
    2020-11-28 22:41

    I used the following code to read all the events in Calendar.

    public boolean isEventInCal(Context context, String cal_meeting_id) {
    
        Cursor cursor = context.getContentResolver().query(
        Uri.parse("content://com.android.calendar/events"),
                new String[] { "_id" }, " _id = ? ",
                new String[] { cal_meeting_id }, null);
    
        if (cursor.moveToFirst()) {
            // will give all events
            return true;
        }
    
        return false;
    }
    

提交回复
热议问题