Monday, 26 August 2013

Android - adding Twitter handle to phonebook

Android - adding Twitter handle to phonebook

I am trying to add a Twitter handle to a contact using the
ContactsContrtact API, but I can't seem to figure out how to add a custom
protocol to my Intent. Has anyone done something like this?
Intent intent = new Intent(ContactsContract.Intents.SHOW_OR_CREATE_CONTACT,
Uri.parse("mailto: user@example.com"));
Intent.putExtra(ContactsContract.Intents.Insert.IM_HANDLE, "username");
Intent.putExtra(ContractsContact.Intents.Insert.IM_PROTOCOL, "twitter");
startActivity(intent);
This does not work probably because the Intent extras are not associated
with one another? I was looking into something along the line of using the
ContentProviderOperation like this code snippet.

No comments:

Post a Comment