Frage

I have implemented an app in which I can pick a contact and list some custom information about this contact in a tablelayout. In each row of this tablelayout I have a column (button) which should send a message to the specific user using sms, whatapp, hike, etc. On click event, the Action_Send intent should open but instead having to pick the contact I want to put the contact or contact id as an extra so that I do not have to choose the contact from the list in whatsapp/sms/hike intent. Is this possible or do I have to implement the send to picker on my own and start a specific intent for each app?

Cheers Magnus

War es hilfreich?

Lösung

You have to implement the send action for different messaging apps like hike whatsapp hike etc. as you can't tell these apps to send a message to a specific contact as the database is protected.

Reason

  1. You never know which contact has what id in these apps like for you what may be "foo" can be something else in whatsapp database.

So all you have to do this is just put data and package name.

Hike - com.bsb.hike
Whatsapp - com.whatsapp

Intent i=new Intent();
i.setPackageName("");
startActivity(i);

Hope it helps.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top