【问题标题】:How can I pass my string to the email intent?如何将我的字符串传递给电子邮件意图?
【发布时间】:2017-01-31 18:07:38
【问题描述】:
        @OverrideView view){
            StringBuffer buffer = new StringBuffer();
            buffer.append(textQr = text.getText().toString().trim());
            buffer.append(text2Qr = text2.getText().toString().trim());
            buffer.append(text3Qr = text3.getText().toString().trim());
            String pass = buffer.toString();



            MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
            try{
                BitMatrix bitMatrix = multiFormatWriter.encode(pass, BarcodeFormat.QR_CODE, 300,300);
                BarcodeEncoder barcodeEncoder = new BarcodeEncoder();
                Bitmap bitmap = barcodeEncoder.createBitmap(bitMatrix);
                image.setImageBitmap(bitmap);

我已经使用 Stringbuffer 类捕获了所有字符串。我想做一个电子邮件生成器。 text,text2,text3 是它们各自的收件人、主题、正文。当我生成和发送电子邮件时,文本并没有各自的内容。我该怎么做?

【问题讨论】:

  • 您应该首先努力发布一个最小但完整且可验证的示例 (stackoverflow.com/help/mcve)。首先:清楚地说明你想做什么如何你正在尝试,以及你期望什么。第二:包括你的类和方法的所有重要部分,而不仅仅是一个不完整的摘录。第三:把名字用语义代替text2,`text3...

标签: javascript java android email


【解决方案1】:

试试这个

Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
                "mailto", "support@hello.com", null));
        emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Hello World");
        emailIntent.putExtra(Intent.EXTRA_TEXT, "ABC");
        startActivity(Intent.createChooser(emailIntent, "Send email..."));

【讨论】:

    猜你喜欢
    • 2017-02-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-05
    • 1970-01-01
    • 2018-09-26
    • 2014-01-28
    相关资源
    最近更新 更多