0
我想了解gmail-widget發送的意圖,以在原始的Gmail應用程序中打開郵件。如果我在widget點擊一個電子郵件,我會得到以下的logcat輸出:在logcat中顯示的意圖額外
09-29 14:42:51.312: I/ActivityManager(1550): START u0
{act=android.intent.action.VIEW
dat=content://com.google.android.gm.email.provider/uimessage/87?threadOp=true&appVersion=58454703&folderUri=content://com.google.android.gm.email.provider/uifolder/1 typ=application/gm-email-ls flg=0x1000c000 pkg=com.google.android.gm cmp=com.google.android.gm/.ui.MailActivityGmail (has extras)} from uid 10066 on display 0
但我沒有得到如何顯示其發送了臨時演員。如果我嘗試模仿動作,我只會看到Gmail收件箱。我正在使用此代碼:
Intent defineIntent =new Intent(Intent.ACTION_VIEW, Uri.parse("content://com.google.android.gm.email.provider/uimessage/86?threadOp=true&appVersion=58454703&folderUri=content://com.google.android.gm.email.provider/uifolder/1"));
Bundle extra = new Bundle();
extra.putString("exchange_username", "XXX");
extra.putString("email_address", "XXXX");
defineIntent.setType("application/gm-email-ls");
defineIntent.setPackage("com.google.android.gm");
defineIntent.setClassName("com.google.android.gm", "com.google.android.gm.ui.MailActivityGmail");
defineIntent.putExtras(extra);
defineIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(defineIntent);
收件箱中後,所示的Gmail應用拋出logcat的一個錯誤:
09-29 14:46:01.457:W/Gmail的(13334):捆綁中的email_address爲空
但我在我的extra-bundle中設置了email_adress字符串。
是的,當然。但只有當意向被髮送到我自己的應用程序。我可以看到Intents是通過安裝在我的Logcat中模擬器中的其他應用程序發送的,但沒有看到額外信息(只是提示:「有附加功能」)。 –