Android Button onclick submit to email -
Android Button onclick submit to email -
i have been working java , xml few months now, , have learned great deal everyones help on stackoverflow.
my question java programming android in relation submit button.
currently trying figure out how submit value email address (behind scenes)
lets have text field , button; want take value entered in text field, , submit email address onclick.
i unable find online shows me how this.
thank in advance reading through post , forwards suggestions.
this great illustration of how using intents can come in great handy! android has bunch of pre-defined intents things within system; may have clicked on image before , dialog popped asking whether view in gallery or in third-party app such astro. viewing of image has own pre-determined intent.
sending email has own pre-determined intent: android.content.intent.action_send. you'll need create intent property , attach info (ie. address send to, subject/message body, etc.).
example code:
// info members private intent emailintent; private string feedback; private edittext feedbackbox; // create intent, , give pre-defined value // android machine automatically associates // sending email. emailintent = new intent(android.content.intent.action_send); emailintent.settype("plain/text"); // set info intent, including email address // wish send to, , subject (optional, of course). emailintent.putextra(android.content.intent.extra_email, new string[]{"your_email@whatever.com"}); emailintent.putextra(android.content.intent.extra_subject, "insert subject here"); // acquire feedback edittext , save string. feedback = feedbackbox.gettext().tostring(); // set message intent more information, emailintent.putextra(android.content.intent.extra_text, feedback); // start intent, launch user's email // app (make sure save necessary info in app // in onpause() method, launching email intent // pause app). create discussed above - // popup box user can utilize determine app // utilize in order send email. startactivity(intent.createchooser(emailintent, "insert title dialog box.")); i hoped helped!!
some sources might check out: http://developer.android.com/guide/topics/intents/intents-filters.html http://developer.android.com/reference/android/content/intent.html#action_send
android form-submit email-client
Comments
Post a Comment