6

标题说明了一切:CalendarContract.EventsColumns.CUSTOM_APP_URI 是干什么用的?

我问是因为我正在寻找一个地方,我的应用程序可以将一些特定于应用程序的数据填充到事件表中。也许这是一个徒劳的问题,因为当然,我需要确保其他一些应用程序不会破坏我的数据。

也许一个更好的问题是:如何在日历事件表中存储特定于应用程序的数据?

4

1 回答 1

2

正如 CalendarContract 中提到的:

/**
 * Activity Action: Display the event to the user in the custom app as
 * specified in {@link EventsColumns#CUSTOM_APP_PACKAGE}. The custom app
 * will be started via {@link Activity#startActivityForResult(Intent, int)}
 * and it should call {@link Activity#setResult(int)} with
 * {@link Activity#RESULT_OK} or {@link Activity#RESULT_CANCELED} to
 * acknowledge whether the action was handled or not.
 *
 * The custom app should have an intent-filter like the following
 * <pre>
 * {@code
 * <intent-filter>
 *    <action android:name="android.provider.calendar.action.HANDLE_CUSTOM_EVENT" />
 *    <category android:name="android.intent.category.DEFAULT" />
 *    <data android:mimeType="vnd.android.cursor.item/event" />
 * </intent-filter>
 * }
 * </pre>
 * <p>
 * Input: {@link Intent#getData} has the event URI. The extra
 * {@link #EXTRA_EVENT_BEGIN_TIME} has the start time of the instance. The
 * extra {@link #EXTRA_CUSTOM_APP_URI} will have the
 * {@link EventsColumns#CUSTOM_APP_URI}.
 * <p>
 * Output: {@link Activity#RESULT_OK} if this was handled; otherwise
 * {@link Activity#RESULT_CANCELED}
 */

// @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_HANDLE_CUSTOM_EVENT = "android.provider.calendar.action.HANDLE_CUSTOM_EVENT";

于 2013-12-28T18:01:20.030 回答