我有代碼爲ACTION_SEND意圖過濾特定的應用程序。 但我無法設置Gmail和郵件EXTRA_EMAIL。PutExtra EXTRA_EMAIL如何爲Action_send?
我試試這個:
String packageName = ri.activityInfo.packageName;
if(packageName.contains("email"))
{
emailIntent.setPackage(packageName);
}
else if(packageName.contains("android.gm") || packageName.contains("mail"))
{
Intent intent = new Intent();
intent.setComponent(new ComponentName(packageName, ri.activityInfo.name));
intent.setAction(Intent.ACTION_SEND);
intent.setType("text/plain");
if(packageName.contains("android.gm")) {
intent.putExtra(Intent.EXTRA_SUBJECT, resources.getString(R.string.share_email_subject));
intent.putExtra(Intent.EXTRA_EMAIL,"[email protected]");
你用什麼v?通過這種方式@PG_Android – programmer 2014-08-30 09:51:27