android - CalendarContract.EventsColumns.CUSTOM_APP_URI 的用途是什么?

标签 android calendar

标题说明了一切: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/

相关文章:

android - 使用 Koush Ion 库上传多部分文件

Android布局 View ID名称问题

java - 在 Java 中创建 Calendar 对象的临时副本

javascript - 在 javascript 中调用自定义函数而不是 getfullyear()

java - java中 'EST'时区的两个日期之间的差异

java - 如何在 PageViewer 中显示 3 个 fragment

android - Android Studio 查看 XML 布局时出错

java - 在 Android Oreo 8.x 中更改 WiFi 热点的 SSID 和密码

java - 将 Java 公历转换为字符串

calendar - VTIMEZONE 在 calendar 中有何用途?为什么不只是 UTC 时间?