How to start a new activity from the account icon in contacts

I have an account authenticator and a sync adapter that stores the contacts of my application separately in my account. An account icon is also displayed for these contacts. But I don’t understand how to go into action as soon as I click the specific user account icon.

For example, if you click the whatsapp icon in our contacts, this will lead us to the whatsapp chat page of this particular user. Similarly, I need to call an intent that will result in an Activity.

Where should I make the necessary changes and what code should be added.

+4
source share
1 answer

Please check this link https://developer.android.com/guide/topics/providers/contacts-provider.html#SocialStreamAcctType

and don't forget to add this intent filter to the activity you want to open:

<intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="YOUR MIME TYPE HERE" />
        </intent-filter>  
0
source

Source: https://habr.com/ru/post/1545187/


All Articles