Skip to content Skip to sidebar Skip to footer

Intent Filter For Handling Address Press In Contact?

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 s

Solution 1:

in ICS you should use this:

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

The received intent should be handled accordingly (diffrently). please note that on ICS and with this intent-filter you don't need a special permission to read contact address.

Solution 2:

The solution, provided by Google Developer Relations is:

<intent-filterandroid:label="MyApp"><actionandroid:name="android.intent.action.VIEW" /><categoryandroid:name="android.intent.category.DEFAULT" /><dataandroid:mimeType="vnd.android.cursor.item/postal-address_v2" /></intent-filter>

Solution 3:

for early versions of Android I used

<intent-filter><actionandroid:name="android.intent.action.VIEW" /><categoryandroid:name="android.intent.category.DEFAULT" /><dataandroid:mimeType="vnd.android.cursor.item/*"android:host="com.android.contacts"android:pathPrefix="/data"android:scheme="content"/></intent-filter>

Solution 4:

VIEW is supposed to be capitalized. Yours is not.

Post a Comment for "Intent Filter For Handling Address Press In Contact?"