从默认日历的事件描述中打开应用程序?

Open app from default Calendar's Event description?

我正在尝试使用 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("xyx@gmail.com"),
                    new EventAttendee().setEmail("abc@gmail.com"),
                    new EventAttendee().setEmail("axc@gmail.com"),

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

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

我从 link 那里了解到我们可以使用

来做到这一点
values.put(CalendarContract.Events.CUSTOM_APP_PACKAGE, getPackageName());
values.put(CalendarContract.Events.CUSTOM_APP_URI, "myAppointment://1");

但没有找到通过 google calendar api 添加 CUSTOM_APP_PACKAGECUSTOM_APP_URI 的任何方法。 我感谢您的帮助。谢谢

我想要实现的示例。

这里有一个CalendarContract.EventsColumns documentation开始。

protected static interface CalendarContract.EventsColumns

Columns from the Events table that other tables join into themselves.

从那里的摘要中,您会找到 CUSTOM_APP_PACKAGECUSTOM_APP_URI

的实现

CUSTOM_APP_PACKAGE

String CUSTOM_APP_PACKAGE

The package name of the custom app that can provide a richer experience for the event. See the ACTION TYPE ACTION_HANDLE_CUSTOM_EVENT for details.

CUSTOM_APP_URI

String CUSTOM_APP_URI

The URI used by the custom app for the event.

您可以使用 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");