2012-09-26 29 views
0

我有功能發送郵件,它看起來像這樣如何更改默認的郵件地址

private void email(String emailTo, String subject, String emailText, ArrayList<DummyItem> lstItemsUpload) { 

     // need to "send multiple" to get more than one attachment 
     final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); 

     emailIntent.setType("plain/text"); 

     emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{ emailTo}); 
     emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject); 
     emailIntent.putExtra(Intent.EXTRA_TEXT, emailText); 

     // has to be an ArrayList 
     ArrayList<Uri> uris = new ArrayList<Uri>(); 

     // convert from paths to Android friendly Parcelable Uri's 
     for (int i = 0; i < lstItemsUpload.size(); i++) { 
      MyItem myItem = lstItemsUpload.get(i); 

      File fileIn = new File(myItem.getPath()); 
      Uri u = Uri.fromFile(fileIn); 
      uris.add(u); 
     } 
     emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris); 

     startActivity(Intent.createChooser(emailIntent, "Send mail...")); 
    } 

如果我選擇在選配的電子郵件應用程序,它會得到默認的郵件地址和文本放置框。

有什麼辦法把從郵件地址代碼,這樣的電子郵件應用程序將使用輸入郵件地址,而不是默認的郵件地址

回答

0

我不認爲你可以更改默認因爲郵件客戶端鏈接到用戶的郵件地址。

+0

感謝您的幫助Soni – quantm

相關問題