Android的意图电子邮件和邮件正文 [英] Android email intent and message body

查看:120
本文介绍了Android的意图电子邮件和邮件正文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的意图,从我的应用程序启动电子邮件应用程序。予置主体,短消息,并使用意图的电子邮件地址。一切工作正常,除了在电子邮件中节光标位置。我的电子邮件就像是感谢选购...... ................. 请不要在此线下面。

我看到电子邮件正文的消息,但我的光标闪烁下面的不要写......行。我怎样才能使光标显示我的消息之前,让用户可以开始输入。

下面是我的code

 意图emailIntent =新的意图(android.content.Intent.ACTION_SEND);
    emailIntent.setType(纯/文);
    emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,新的String [] {getResources()的getString(R.string.helpSenderAddress)});
    emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,getResources()的getString(R.string.helpSubject));
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, String.format(getResources().getString(R.string.helpMessage),Build.VERSION.RELEASE,getPackageManager().getPackageInfo(getPackageName(),0).version$c$c));
 

解决方案

我不喜欢回答这个样子,但是:你不能。你无法控制如何将任意其他程序将采取行动,一旦它满足了意向。

I'm using intent to launch email application from my application. I set subject, short message and email address using the intent. Everything works fine except that cursor position in the email message section. My email message is like "Thank for choosing ...... ................. Do not write below this line.

I see the message in the email body, but my cursor is blinking below the "Do not write ..." line. How can i make the cursor appear before my message, so that user can just start to type.

Here is my code

    Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
    emailIntent.setType("plain/text");
    emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{ getResources().getString(R.string.helpSenderAddress)});
    emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, getResources().getString(R.string.helpSubject));
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, String.format(getResources().getString(R.string.helpMessage),Build.VERSION.RELEASE,getPackageManager().getPackageInfo(getPackageName(),0).versionCode));

解决方案

I hate answering like this, but: you can't. You can't control how an arbitrary other program will act once it fulfills the intent.

这篇关于Android的意图电子邮件和邮件正文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆