什么是&QUOT相关联的意图;查看工作地址]按钮在联系人/联系卡? [英] What is the intent associated with "View work address" in Contacts / Contact Card?
问题描述
我想注册一个意图过滤器,以人民的应用程序查看工作地址的动作可以启动我的应用程序 - 但是那是什么意图
?通过联系人源$ C $ C搜索了一整天后,我想出了以下解决方案:
- 进入谷歌的市场和安装意图拦截
- 捕获数据。在这种情况下,它看起来是这样的:
动作: android.intent.action.VIEW
数据:内容://com.android.contacts/data/1425
乌里:内容://com.android.contacts/data/1425
键入:空
3的活动符合这个目的:
com.telenav.app.android.sprint
com.google.android.apps.maps
uk.co.ashtonbrsc.android.intentintercept
块引用>然后我去了文档,找到了我应该得到...
http://developer.android.com/guide/appendix/ G-APP-intents.html
你可以想像,我很震惊不希望看到用了一个地球计划。 (这就解释了为什么我不能在源$ C $ C找到地理URI)。
编辑:我想实现应用程序的意图过滤器;它不是那么容易破解这个...
这工作 - 但它也抓住不是查看工作地址等意图(这是不好的)
<意向滤光器>
<作用机器人:名字=android.intent.action.VIEW/>
<类机器人:名字=android.intent.category.DEFAULT/> <数据机器人:mime类型=* / *机器人:计划=内容机器人:主机=com.android.contacts/> &所述; /意图滤光器>编辑2:这是最好的意图过滤器,我可以拿出这个场景
<意向滤光器>
<作用机器人:名字=android.intent.action.VIEW/>
<类机器人:名字=android.intent.category.DEFAULT/>
<数据机器人:mime类型=vnd.android.cursor.item / *机器人:主机=com.android.contacts/>
&所述; /意图滤光器>编辑3:我可以做的更好......这是确切的意图过滤器使用
<意向滤光器>
<作用机器人:名字=android.intent.action.VIEW/>
<类机器人:名字=android.intent.category.DEFAULT/>
<数据机器人:mime类型=vnd.android.cursor.item / *机器人:主机=com.android.contacts机器人:路径preFIX =/数据机器人:计划=内容/&GT ;
&所述; /意图滤光器>I'd like to register an intent filter so that the "View work address" action in the People app can launch my app - but what is that intent ?
解决方案After searching all day through the Contacts source code, I came up with the following solution:
- go to the Google market and install "Intent Intercept"
- capture the data. In this case it looks like this:
Action: android.intent.action.VIEW
Data: content://com.android.contacts/data/1425
Uri: content://com.android.contacts/data/1425
Type: null
3 activities match this intent:
com.telenav.app.android.sprint
com.google.android.apps.maps
uk.co.ashtonbrsc.android.intentintercept
I then went to the documentation to find out what I should have gotten...
http://developer.android.com/guide/appendix/g-app-intents.html
As you can imagine, I was shocked not to see a "geo" scheme used. (which explains why I couldn't find the geo URI in the source code).
EDIT: I am trying to implement the app's intent-filter; it's not so easy to hack this...
this works - but it also captures intents other than "View work address" (which is not good)
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="*/*" android:scheme="content" android:host="com.android.contacts" /> </intent-filter>
EDIT 2: this is the best intent-filter I can come up with for this scenario
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.item/*" android:host="com.android.contacts" /> </intent-filter>
EDIT 3: I can do better ... this is the EXACT intent filter to use
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.item/*" android:host="com.android.contacts" android:pathPrefix="/data" android:scheme="content"/> </intent-filter>
这篇关于什么是&QUOT相关联的意图;查看工作地址]按钮在联系人/联系卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!