Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Predefined actions of application. Link to my application from Contacts

Tags:

android

dialog

I want to write application which is connected with Contacts.

Scenario :

  1. Enter to phone Contacts
  2. We choose Contact itementer image description here

  3. And icon of my application should appear in QuickAction Dialog.

  4. I click on my app icon and Aplication start with data from contact record.

What I have to add to AndroidManifest to do it?

like image 924
plancys Avatar asked Feb 20 '23 04:02

plancys


1 Answers

Add this intent filter for your app to be visible for all contacts.

    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="vnd.android.cursor.item/name" />
    </intent-filter>

Change the mimetype, so that only contacts with a particular data have your activity.

e.g if you want your activity to show only for contacts with email then change mimetype to vnd.android.cursor.item/email_v2 . You can get the mimetype names from the subclasses of DataColumns

like image 107
nandeesh Avatar answered May 01 '23 17:05

nandeesh