我想创建一种自定义方式来将新事件输入日历。
据我所知,通过创建响应日历应用发送的 Intent 的应用应该很容易。我在我的应用程序中创建了以下 Activity :
<activity android:name=".Main"
android:label="@string/app_name">
<!-- for normal launch -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.EDIT" />
<category android:name="android.intent.category.ALTERNATIVE" />
<!-- also tried DEFAULT and others -->
<data android:mimeType="vnd.android.cursor.item/event" />
</intent-filter>
</activity>
但仍然只弹出内置对话框。从我在日历应用程序的源代码中看到的情况来看,Intent 并未在那里进行硬编码。
我是否漏掉了一些明显的东西?
最佳答案
在深入研究源代码后,我发现 Intent 目标类是硬编码的。因此无法覆盖事件编辑 Activity 。 ;-(
关于android - 如何拦截 Intent (用于日历事件创建),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6021689/