I'm looking for the code to start WhatsApp call from my app and I haven't found any solution to that yet.
This must be possible because in Android contacts there is the Call number from WhatsApp option when you see any contact information.
I'm looking for the code to start WhatsApp call from my app and I haven't found any solution to that yet.
This must be possible because in Android contacts there is the Call number from WhatsApp option when you see any contact information.
I believe this is what you are looking for:
Intent intent = new Intent(Intent.ACTION_DIAL);
/* sets the desired package for the intent */
intent.setPackage("com.whatsapp");
intent.setData(Uri.parse("tel:xxxxxxxxxx"))
startActivity(intent);
source; How to make a phone call using intent in Android?
Not sure if the package will automatically use the app though.
This will allow the user to select how they would like the perform the call. The whatsapp app should be setup to provide itself as a way of making calls.