SeriousM SeriousM - 8 months ago 36
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.


So simple...

Uri uri = Uri.parse("content://" + rawContactId);
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(uri, rawContactMimetype);