コード例 #1
0
 /**
  * Create an intent to launch and open account's inbox.
  *
  * @param accountId If -1, default account will be used.
  */
 public static Intent createOpenAccountIntent(
     Activity fromActivity, long accountId, boolean fromKeyguard) {
   Intent i = IntentUtilities.createRestartAppIntent(fromActivity, EmailActivity.class);
   if (accountId != -1) {
     i.putExtra(EXTRA_ACCOUNT_ID, accountId);
     i.putExtra(EXTRA_FROM_KEYGUARD, fromKeyguard);
   }
   return i;
 }
コード例 #2
0
 /**
  * Create an intent to launch and open a mailbox.
  *
  * @param accountId must not be -1.
  * @param mailboxId must not be -1. Magic mailboxes IDs (such as {@link
  *     Mailbox#QUERY_ALL_INBOXES}) don't work.
  */
 public static Intent createOpenMailboxIntent(
     Activity fromActivity, long accountId, long mailboxId, boolean fromKeyguard) {
   if (accountId == -1 || mailboxId == -1) {
     throw new IllegalArgumentException();
   }
   Intent i = IntentUtilities.createRestartAppIntent(fromActivity, EmailActivity.class);
   i.putExtra(EXTRA_ACCOUNT_ID, accountId);
   i.putExtra(EXTRA_MAILBOX_ID, mailboxId);
   i.putExtra(EXTRA_FROM_KEYGUARD, fromKeyguard);
   return i;
 }