第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何在安卓中打開gmail

如何在安卓中打開gmail

jeck貓 2022-10-20 17:21:07
我只是想通過我的應(yīng)用程序打開 Gmail 應(yīng)用程序,并想從我的應(yīng)用程序設(shè)置電子郵件、主題和消息。我嘗試過 GmailService,但它不支持密件抄送或抄送電子郵件。鏈接:https ://github.com/yesidlazaro/GmailBackgroundBackgroundMail.newBuilder(this)    .withUsername("username@gmail.com")    .withPassword("password12345")    .withMailto("toemail@gmail.com")    .withType(BackgroundMail.TYPE_PLAIN)    .withSubject("this is the subject")    .withBody("this is the body")    .withOnSuccessCallback(new BackgroundMail.OnSuccessCallback() {        @Override        public void onSuccess() {            //do some magic        }    }).withOnFailCallback(new BackgroundMail.OnFailCallback() {        @Override        public void onFail() {            //do some magic        }    }).send();我想將密件抄送和抄送功能與附件、主題和消息一起使用。
查看完整描述

4 回答

?
慕無忌1623718

TA貢獻(xiàn)1744條經(jīng)驗(yàn) 獲得超4個(gè)贊

// 對于任何應(yīng)用程序的電子郵件

Intent email= new Intent(Intent.ACTION_SENDTO);
                email.setData(Uri.parse("mailto:your.email@gmail.com"));
                email.putExtra(Intent.EXTRA_SUBJECT, "Subject");
                email.putExtra(Intent.EXTRA_TEXT, "My Email message");
                startActivity(email);


查看完整回答
反對 回復(fù) 2022-10-20
?
達(dá)令說

TA貢獻(xiàn)1821條經(jīng)驗(yàn) 獲得超6個(gè)贊

通過 Intent 打開 gmail


Intent intent = new Intent(Intent.ACTION_VIEW);

intent.setData(Uri.parse("abc@gmail.com"));

intent.setClassName("com.google.android.gm", "com.google.android.gm.ComposeActivityGmail");

intent.putExtra(Intent.EXTRA_CC, new String[]{"xyz@gmail.com"});

intent.putExtra(Intent.EXTRA_BCC, new String[]{"pqr@gmail.com"});

intent.putExtra(Intent.EXTRA_SUBJECT, "your subject goes here...");

intent.putExtra(Intent.EXTRA_TEXT, "Your message content goes here...");

    

startActivity(intent);

只需在意圖參數(shù)中傳遞EXTRA_CC&EXTRA_BCC


編輯


以下答案適用于android 11


Intent intent = new Intent(Intent.ACTION_SENDTO);

intent.setData(Uri.parse("mailto:"));

intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"abc@gmail.com"});

intent.putExtra(Intent.EXTRA_SUBJECT, "Your subject here...");

intent.putExtra(Intent.EXTRA_TEXT,"Your message here...");

startActivity(intent);

編輯 2


val selectorIntent = Intent(Intent.ACTION_SENDTO)

selectorIntent.data = Uri.parse("mailto:")


val emailIntent = Intent(Intent.ACTION_SEND)

emailIntent.putExtra(Intent.EXTRA_EMAIL, arrayOf("recipient@mail.com"))

emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject here...")

emailIntent.putExtra(Intent.EXTRA_TEXT, "Email Body...")

emailIntent.selector = selectorIntent


activity!!.startActivity(Intent.createChooser(emailIntent, "Send email..."))


查看完整回答
反對 回復(fù) 2022-10-20
?
慕哥6287543

TA貢獻(xiàn)1831條經(jīng)驗(yàn) 獲得超10個(gè)贊

// 這是用于 Gmail 應(yīng)用程序的

Intent email= new Intent(Intent.ACTION_VIEW);
            email.setType("message/rfc822")
            .setData(Uri.parse("mailto:your.email@gmail.com"))
            .putExtra(Intent.EXTRA_EMAIL, "your.email@gmail.com")
            .putExtra(Intent.EXTRA_SUBJECT, "Subject")
            .putExtra(Intent.EXTRA_TEXT, "My Email message")
            .setPackage("com.google.android.gm");
            startActivity(email);


查看完整回答
反對 回復(fù) 2022-10-20
?
哈士奇WWW

TA貢獻(xiàn)1799條經(jīng)驗(yàn) 獲得超6個(gè)贊

//這是用gmail打開的

Intent i = new Intent(Intent.ACTION_SENDTO);
            i.setType("text/plain");
            i.setData(Uri.parse("mailto:"));
            i.putExtra(Intent.EXTRA_EMAIL  , new String[]{"recipient@gmail.com"});
            i.putExtra(Intent.EXTRA_SUBJECT, "Mail Subject");
            i.putExtra(Intent.EXTRA_TEXT   , "massage");
            i.setPackage("com.google.android.gm");            try {
                startActivity(Intent.createChooser(i, "Send mail..."));
            } catch (android.content.ActivityNotFoundException ex) {
                Toast.makeText(AnotherActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
            }



查看完整回答
反對 回復(fù) 2022-10-20
  • 4 回答
  • 0 關(guān)注
  • 306 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)