Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android email intent and message body

Tags:

android

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));
like image 1000
prashant Avatar asked May 09 '11 17:05

prashant


1 Answers

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.

like image 188
Jeremy Logan Avatar answered Nov 10 '22 15:11

Jeremy Logan