캘린더에 새 이벤트를 추가하려고합니다 (최소 sdk 버전은 2.2 임).캘린더에 새 이벤트를 삽입하는 중 오류가 발생했습니다.
ContentValues event = new ContentValues();
event.put("calendar_id", 2);
event.put("title", "mytitle");
event.put("description", "desc");
event.put("eventLocation", "loc");
event.put("eventTimezone", Calendar.getInstance().getTimeZone().getDisplayName());
long startTime = System.currentTimeMillis() + 1000 * 60 * 60;
Long duration = 1000L * 60 * 30;
event.put("dtstart", startTime);
event.put("duration", duration);
Uri eventsUri = Uri.parse("content://com.android.calendar/events");
Uri insertedUri = getContentResolver().insert(eventsUri, event);
그러나 insertedUri
는 항상 null입니다 : 내가 지금까지 가지고있는 코드는
.
또한 내 로그 캣에서 그 라인을 볼 수
Failed to find provider info for calendar
누군가가 나를 도와 드릴까요?
감사합니다.
하지만 난 내 장치에있다. 왜 아직도 아무것도 추가 할 수 없습니까? – Royi
Google 캘린더 – Akhil
을 사용하는 경우 https://developers.google.com/google-apps/calendar/ API를 사용하는 것이 더 좋습니다. 기기가 오프라인 인 경우 이벤트를 추가 할 수있는 방법이 있습니까? – Royi