java - Email intent in constant loop -
ive got email intent working in posts emails. im getting issue 1 time click 'send email' on custom template, sets 'to', 'subject' , 'message' fields of gmail template loads fine when click 'send' on gmail template loops custom template. shown:
this custom made email template:
once 'send email' clicked gmail template loaded:
once 'send' button of gmail template cliked loops custom template , loop between each other continuously. hoping can give me thought of how can stop looping!
here code intent within 'onclick':
package com.example.flybase2; import android.app.activity; import android.app.dialog; import android.content.intent; import android.os.bundle; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; import android.widget.textview; public class contactsemail extends activity implements onclicklistener{ string emailpassed; string emailadd; string emailsub; string emailmess; edittext setemailaddress; edittext setemailsubject; edittext setemailmessage; button btnsendemail; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.emaillayout); bundle extras = getintent().getextras(); if (extras != null) { emailpassed = extras.getstring("passedemailadd"); } setemailaddress = (edittext) findviewbyid (r.id.inputemailaddress); setemailaddress.settext(emailpassed); setemailsubject = (edittext) findviewbyid (r.id.inputemailsubject); setemailmessage = (edittext) findviewbyid (r.id.inputemailmessage); btnsendemail = (button)findviewbyid(r.id.btnsendemail); btnsendemail.setonclicklistener(this); } @override public void onclick(view sendemailclick) { emailadd = setemailaddress.gettext().tostring(); emailsub = setemailsubject.gettext().tostring(); emailmess = setemailmessage.gettext().tostring(); intent sendemailintent = new intent(intent.action_send); sendemailintent.settype("plain/text"); sendemailintent.putextra(intent.extra_email,new string[] {emailadd}); sendemailintent.putextra(intent.extra_subject, emailsub); sendemailintent.putextra(intent.extra_text, emailmess); startactivity(intent.createchooser(sendemailintent, "send mail...")); }
}
it looks want phone call finish()
@ end of onclick()
. close contactsemail allowing user homecoming more useful activity gmail app.
java android android-intent
No comments:
Post a Comment