How to integrate your app in QUICK CONTACT on the native contact app on android?

て烟熏妆下的殇ゞ 提交于 2019-12-08 23:12:31
kingston

I think I know now what you mean. I don't think it is possible through the manifest file. You need to add a profile action. Please check the SampleSyncAdapter for the way to do it. You can even add more actions and when the user clicks on the icon, the list of the available actions is shown. Then you need to handle the action but you said you don't care about that...

Check also this:

Profile action

So you need to create your own sync adapter and create your raw-contacts. Only Contacts that have a Raw_Contact with your profile will show the icon. The shown icon is that one defined in your authenticator.xml file.

Right that is what I used too:

<intent-filter>
            <action
                android:name="android.intent.action.SENDTO" />
            <data
                android:scheme="sms" />
            <data
                android:scheme="smsto" />
            <category
                android:name="android.intent.category.DEFAULT" />
</intent-filter>

Then in the onCreate and in the onNewIntent you need to get the intent (use getIntent() in onCreate). From the intent check the action by using intent.getAction(); If (action.equalsIgnoreCase(Intent.ACTION_SENDTO)) you need to handle the sending of your message. With intent.getData() you get the uri of the contact.

//Not quite there yet but close.

<intent-filter>
                <action
                    android:name="android.intent.action.SENDTO" />
                <data
                    android:scheme="sms" />
                <data
                    android:scheme="smsto" />
                <category
                    android:name="android.intent.category.DEFAULT" />
            </intent-filter>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!