Try this magic code:
Intent i = *new* Intent(android.content.Intent.ACTION_SEND);
//i.setType("text/plain"); //use this line for testing in the emulator
i.setType("message/rfc822") ; // use from live device*
i.putExtra(Intent.EXTRA_SUBJECT, "Subject of this great email");
i.putExtra(Intent.EXTRA_EMAIL, *new* String[]{"[email protected]"});
startActivity(Intent.*createChooser*(i, "Choose email app"));
kl. 07:43:34 UTC+2 fredag 13. april 2012 skrev Put_tiMe følgende:
>
> I'm looking at this: if *com.android.email* package exists, then I want
> to open the "compose" activity, and automatically fill up the fields, such
> as 'to', 'subject', etc...
>
> If the default mail package doesn't exist, then I don't mind showing the
> chooser.
>
> The reason I want to do this is:
> I know I want to send an e-mail. I don't want the user to choose
> 'bluetooth'.
> Because I know I don't want to use the 'bluetooth'.
>
> I need to do at least this: the chooser should should only the e-mail
> capable apps. is that possible?
>
>
>
>
> On Thursday, April 12, 2012 9:07:45 PM UTC+5:30, TreKing wrote:
>>
>> In addition to what's been said, there exists the remote possibility that
>> an email app does not even exist on a device, in which case your attempt to
>> "go directly to the 'default' email app" will fail miserably.
>>
>>
>> -------------------------------------------------------------------------------------------------
>> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
>> transit tracking app for Android-powered devices
>>
>>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en