我正在開發一個電話應用程序,并具有向特定電話號碼/聯系人發送自動眨眼 (;)) 的功能: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
提交
取消