SeriousM SeriousM - 1 year ago 75
Android Question

How to make android raw-contact communicate intent?

I'm getting Cursor with RAW_CONTACTS for person in my app.
How can i use this data to start an Intent to communicate with this person via one of selected raw-contacts?

For example, one contacts has several raw-contacts: phone, whatsapp, viber etc. When i click whatsapp raw_contact, app should start WhatsApp to communicate with selected person.

Answer Source

So simple...

Uri uri = Uri.parse("content://" + rawContactId);
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(uri, rawContactMimetype);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download