我想通過設置聯繫人發送消息WhatsApp。將顯示聯繫人的WhatsApp配置文件,但EditText的內容未設置爲WhatsApp配置文件。什麼是ACTION_SENDTO的設置類型
我的代碼是:
String id =etxnumber.getText().toString();
Uri uri = Uri.parse("smsto:" + id);
String text1 =etxmsg.getText().toString();
Intent i = new Intent(Intent.ACTION_SENDTO, uri);
i.setPackage("com.whatsapp");
i.putExtra(Intent.EXTRA_TEXT, text1);
i.setType("text/plain");
startActivity(i);
錯誤是:
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SENDTO typ=text/plain pkg=com.whatsapp (has extras) }