android - 如何拦截 Intent (用于日历事件创建)

标签 android android-manifest

我想创建一种自定义方式来将新事件输入日历。

据我所知,通过创建响应日历应用发送的 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/

相关文章:

java - 如何执行一个 Activity N次,其中N是用户输入

android - 对我的结构 Activity 的建议 (Android)

android - 我可以在我的 View 模型中创建实时数据观察器吗?还是我应该始终观察 fragment/Activity ?

Android Deeplinking 不适用于多种方案

android - 内容提供者的应用程序如何指定客户端应用程序访问提供者数据所需的权限?

Android Market 说我的应用程序是 "not in targeted group"或 "cannot be installed on this device"

javascript - 如何使用 jquery/javascript 获取特定选项的复选框值?

android - “com.example.volleyexample.app.AppController”不可分配给 'android.app.Activity'

android - 多个具有 DEFAULT 类别的 Intent 过滤器

android - 如何创建间距均匀的按钮?