我正在开发一个电话应用程序,并具有向特定电话号码/联系人发送自动眨眼 (;)) 的功能:public void onClickWhatsApp(View view) { PackageManager pm=getPackageManager(); String mensajillo = ";)"; String toNumber = "xxxxxxxxxxx"; //The xs are replaced with the number which I obtain from other function, but that doesn't matter here Intent sendIntent = new Intent(Intent.ACTION_SENDTO,Uri.parse("smsto:" + "" + toNumber + "?body=" + "")); sendIntent.setPackage("com.whatsapp"); startActivity(sendIntent); Intent texintent = new Intent(Intent.ACTION_VIEW); texintent.setData(Uri.parse("http://api.whatsapp.com/send?phone="+toNumber +"&text="+mensajillo)); startActivity(texintent);}问题是它只是打开聊天并写入“;)”,但实际上并没有发送它。我已经读了好几个小时了,我想知道是否有一种方法可以使其自动化。如果您知道一些可以完成我所说的事情的代码,那将非常受欢迎;)
添加回答
举报
0/150
提交
取消