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

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

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

最佳答案

如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)静态最终字符串ACTION_HANDLE_CUSTOM_EVENT =
“android.provider.calendar.action.HANDLE_CUSTOM_EVENT”;

关于android - CalendarContract.EventsColumns.CUSTOM_APP_URI的作用是什么?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14510788/

10-08 23:49