Hi, i did it but i have two problems:

1. Does not send automatically the email when i press the send button,
it shows a new window to edit the tittle, receptor and body of the
email and to send it.¿is not possible to send it automatically without
giving the user the possibility to edit it?

2. I test it and i didn't recibe the email... ¿how many time needs to
be recibed??

On 3 dic, 12:58, Kostya Vasilyev <kmans...@gmail.com> wrote:
> Hi,
>
> You are describing three tasks:
>
> 1 - handling a button click.
>
> http://developer.android.com/guide/topics/ui/ui-events.html
>
> http://developer.android.com/reference/android/view/View.html
>
> see View.setOnClickListener(android.view.View.OnClickListener)
>
> 2 - getting the value of an EditText field (the email address)
>
> http://developer.android.com/reference/android/widget/EditText.html
>
> see getText()
>
> 3 - sending the email.
>
> The code I use is:
>
> > Intent view = new Intent(Intent.ACTION_VIEW);
> > StringBuilder uri = new StringBuilder("mailto:";);
> > uri.append(<email address here>);
> > uri.append("?subject=").append(Uri.encode(<subject here>));
> > uri.append("&body=").append(Uri.encode(<message body here>));
> > view.setData(Uri.parse(uri.toString()));
> > startActivity(view);
>
> There are other ways to specify subject and body, but this one works
> with certain buggy email clients (H*C Se*se).
>
> -- Kostya
>
> 03.12.2010 14:16, saex пишет:
>
> > Hi
>
> > im searching on google and here and i only find hard ways, that i
> > can't understand, because i am starting on android.
>
> > I have a textfield on my app, and a button. I only want that when user
> > press the button, my app have to send a email with the text "Hello" to
> > the direction on the textfield.
>
> > there is a easy way to do it?
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to