如何将我的字符串传递给电子邮件意图?

时间:2016-09-23 01:42:47

标签: javascript java android email-integration

        @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是各自的收件人,主题,正文。当我生成并发送电子邮件时,文本不是各自的内容。我该怎么办?

1 个答案:

答案 0 :(得分:0)

试试这个

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..."));