2017-09-21 2 views
0

나는 google calendar api를 사용하려고하고 그것에 events을 추가 해요 :기본 캘린더의 일정 설명에서 앱을 엽니 다.

/**starting code for adding event */ 

      event = new Event().setSummary("Meeting with employees") 
        .setLocation("Rehman Trade Center, Sargodha Pakistan") 
        .setDescription("Our team is going to organize a Meeting to discuss the Architecture") 
        .; 
      DateTime startDateTime = new DateTime("2017-11-28T09:00:00-07:00"); 
      EventDateTime start = new EventDateTime() 
        .setDateTime(startDateTime) 
        .setTimeZone("America/Los_Angeles"); 
      event.setStart(start); 

      DateTime endDateTime = new DateTime("2017-11-28T17:00:00-07:00"); 
      EventDateTime end = new EventDateTime() 
        .setDateTime(endDateTime) 
        .setTimeZone("America/Los_Angeles"); 
      event.setEnd(end); 



      EventAttendee[] attendees = new EventAttendee[]{ 
        new EventAttendee().setEmail("[email protected]"), 
        new EventAttendee().setEmail("[email protected]gmail.com"), 
        new EventAttendee().setEmail("[email protected]"), 

      }; 
//   event.setAttendees(Arrays.asList(attendees)); 

      event = mService.events().insert("primary", event).execute(); 

나는 우리가하고 CUSTOM_APP_PACKAGE를 추가 할 수있는 방법을

values.put(CalendarContract.Events.CUSTOM_APP_PACKAGE, getPackageName()); 
values.put(CalendarContract.Events.CUSTOM_APP_URI, "myAppointment://1"); 

를 사용하여이 작업을 수행 할 수 있지만 발견되지 않는 link 읽기 CUSTOM_APP_URI ~ google calendar api. 귀하의 도움에 감사드립니다. 감사합니다

내가 달성하고 싶은 것의 예. example

답변

2

여기는 CalendarContract.EventsColumns documentation입니다. 이벤트 테이블에서

protected static interface CalendarContract.EventsColumns 

열은 다른 테이블 자체에 조인.

이 요약에서

, 당신은 CUSTOM_APP_PACKAGE의 구현 및 CUSTOM_APP_URI

를 찾을 수

CUSTOM_APP_PACKAGE

String CUSTOM_APP_PACKAGE 

에 대한 풍부한 경험을 제공 할 수있는 사용자 정의 응용 프로그램의 패키지 이름 행사. 자세한 내용은 동작 유형 ACTION_HANDLE_CUSTOM_EVENT을 참조하십시오.

CUSTOM_APP_URI

String CUSTOM_APP_URI 

이벤트에 대한 사용자 지정 응용 프로그램에서 사용하는 URI.

1

CUSTOM_APP_PACKAGE를 사용하면이 작업을 수행 할 수 있습니다. CUSTOM_APP_PACKAGE와 CUSTOM_APP_URI의 두 가지 옵션을 사용해야합니다.

values.put(CalendarContract.Events.CUSTOM_APP_PACKAGE, getPackageName()); 
values.put(CalendarContract.Events.CUSTOM_APP_URI, "myAppointment://1"); 
+1

감사하지만이 두 가지 모두 나를 위해 작동하지 않습니다. –

+0

괜찮 았나 모르겠지만 지난 번 나를 위해 일한다. – Nomi

+0

음, 괜찮아. –

관련 문제