I want a menu item to be displayed when a user views a contact in an Android app. I thought you need to define an intent filter and it will appear, but it does not work, as I thought it would be
This is my filter intent:
<activity android:name="com.myapp.intents.Contact" android:label="@string/actContactsMenu"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.EDIT" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.item/person" android:host="contacts" /> <data android:mimeType="vnd.android.cursor.item/contact" android:host="com.android.contacts" /> <data android:mimeType="vnd.android.cursor.item/raw_contact" android:host="com.android.contacts" /> </intent-filter> </activity>
When the above menu is not displayed, when I look at a contact, but when I click on a contact in the list, I get a pop-up window with the name of my activity, and when I select it, my activity appears. The same thing happens when I try to edit a contact.
This is not what I want. I want the menu to appear when viewing a contact and editing a contact. Intent filters are not a way to do this?
Thanks for any help.
source share