我正在使用这个代码片段打开whatsapp消息
public void openWhatsApp() {
PackageManager pm = getPackageManager();
try {
String toNumber = "97312345678"; // Replace with mobile phone number without +Sign or leading zeros, but with country code.
userContact = userContact.replace("+", "");
Intent sendIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:" + "" + userContact));
sendIntent.setPackage("com.whatsapp");
startActivity(sendIntent);
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(this, "Whatsapp Not installed", Toast.LENGTH_LONG).show();
}
}
它工作得很好 Huawei y6 android 9
但不是开着 Xiaomi with android 10 note 7
即使在三星也一样
有人能帮我吗?如果数字,如果业务,那会影响什么?
如果是,如何检测?
暂无答案!
目前还没有任何答案,快来回答吧!