/**
* Open Chat with Number
*Example:<code>
*Dim whapp As WhatsApp
*whapp.OpenChatWithNumber("+39334336444")</code>
*/
private final static String WHATSSAP_APP_ID = "com.whatsapp";
public void OpenChatWithNumber(BA ba, String phoneNumber) {
try{
Uri uri = Uri.parse("smsto:" + phoneNumber);
Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
intent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
intent.setPackage(WHATSSAP_APP_ID);
ba.context.startActivity(intent);
}catch(Exception e){
if(DEBUG) Log.e("Exception", e.toString());
int duration = Toast.LENGTH_LONG;
Toast toast = Toast.makeText(ba.context, e.toString(), duration);
toast.show();
}
}