android - 用于处理联系人中的地址新闻的 Intent 过滤器?

标签 android filter dictionary android-intent contacts

各位,在查看联系人时,您可以按地址以在 map 应用程序(例如 Google map 或 VZW Navigator)中查看该地址。我想定义一个 Intent 过滤器,以便我的应用程序将显示在可以处理所述 Intent 的应用程序列表中。有什么想法吗?

提前致谢。

从 logcat 中,我从 ActivityManager 看到以下内容:

Starting activity: 
Intent { act=android.intent.action.VIEW dat=content://com.android.contacts/data/6792 cmp=android/com.android.internal.app.ResolverActivity }

我尝试了几种 Intent 过滤器的组合,例如:

<intent-filter>
  <action android:name=”android.intent.action.View” />
  <category android:name=”android.intent.category.DEFAULT” />
  <category android:name=”android.intent.category.BROWSABLE” />
  <data android:scheme=”geo” />
</intent-filter>

<intent-filter>
  <action android:name=”android.intent.action.View” />
  <category android:name=”android.intent.category.DEFAULT” />
  <category android:name=”android.intent.category.BROWSABLE” />
  <data android:scheme=”content” android:host=”com.android.contacts” android:pathPattern=”/data/*” />
</intent-filter>

最佳答案

在 ICS 中你应该使用这个:

        <intent-filter>
            <action android:name="android.intent.action.VIEW" /> 
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="geo" />
        </intent-filter>

应相应地(不同地)处理收到的 Intent 。 请注意,在 ICS 上并使用此 Intent 过滤器,您不需要特殊权限即可读取联系地址。

关于android - 用于处理联系人中的地址新闻的 Intent 过滤器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4890797/

相关文章:

css - 固定位置不适用于 CSS 模糊过滤器

android - 多场景管理后退按钮

android - 样式选择器可能吗?

CSS hue-从红色旋转到特定颜色

python - 如何有效地检查数据库中是否存在名称

Python 在比较字典的同时执行计算

java - 在 makehttprequest JSONParser 中发布 List<List<NameValuePair>>

android - 是否只能使用 Lua 为 Android 开发应用程序?

python:带有非默认参数的defaultdict

python - 执行 python 脚本时,列 'date' 的值超出范围