在联系处理地址preSS意图过滤器? [英] Intent Filter for handling address press in Contact?
本文介绍了在联系处理地址preSS意图过滤器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
伙计们,查看联系人时,您可以在地址preSS的地图应用程序(如谷歌地图或导航VZW)来查看该地址。我想定义一个意图过滤器,这样我的应用程序将能够处理的意图表示应用程序的列表中显示出来。任何想法?
先谢谢了。
从logcat中,我看到ActivityManager以下内容:
启动活动:
意向{行动= android.intent.action.VIEW DAT =内容://com.android.contacts/data/6792 CMP =机器人/ com.android.internal.app.ResolverActivity}
我试过的意图过滤器,例如一个几种组合:
<意向滤光器>
<作用机器人:名字=android.intent.action.View/>
<类机器人:名字=android.intent.category.DEFAULT/>
<类机器人:名字=android.intent.category.BROWSABLE/>
<数据机器人:计划=地缘/>
&所述; /意图滤光器>&所述;意图滤光器>
<作用机器人:名字=android.intent.action.View/>
<类机器人:名字=android.intent.category.DEFAULT/>
<类机器人:名字=android.intent.category.BROWSABLE/>
<数据机器人:计划=内容机器人:主机=com.android.contacts机器人:pathPattern =/数据/ */>
&所述; /意图滤光器>
解决方案
解决方案,由谷歌开发者关系提供的是:
<意向过滤器的android:标签=MyApp的>
<作用机器人:名字=android.intent.action.VIEW/>
<类机器人:名字=android.intent.category.DEFAULT/>
<数据机器人:mime类型=vnd.android.cursor.item /邮政-address_v2/>
&所述; /意图滤光器>
Folks, when viewing a contact, you can press on the address to view that address in a map application (such as Google Maps or VZW Navigator). I would like define an intent-filter such that my app will show up in the list of apps that can handle said intent. Any ideas?
Thanks in advance.
From logcat, I see the following from ActivityManager:
Starting activity:
Intent { act=android.intent.action.VIEW dat=content://com.android.contacts/data/6792 cmp=android/com.android.internal.app.ResolverActivity }
I've tried a several combinations of intent-filters, e.g.:
<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>
解决方案
The solution, provided by Google Developer Relations is:
<intent-filter android:label="MyApp">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/postal-address_v2" />
</intent-filter>
这篇关于在联系处理地址preSS意图过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文