我設置了兩個按鈕。一個打開撰寫短信的意圖,另一個打開撰寫電子郵件的意圖。短信意圖工作正常,但電子郵件按鈕不響應。香港專業教育學院創建了一個categorychooser但那不露面....直到我點擊短信按鈕Android電子郵件意向
這是我的代碼
case R.id.button2:
{
String phoneNumber = "xxxxxxxxxx";``
Intent smsIntent = new Intent(Intent.ACTION_SENDTO);
smsIntent.addCategory(Intent.CATEGORY_DEFAULT);
smsIntent.setType("vnd.android -dir/mms-sms");
smsIntent.setData(Uri.parse("sms:"+phoneNumber));
startActivity(smsIntent);
}
case R.id.button3:
{
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
emailIntent.setType("plain/text");
startActivity(Intent.createChooser(emailIntent, "Send email..."));
}
任何想法?
你忘了在每個案例 – Lucifer