android - Email app crashes if a photo is not available for attachment -


my app has option take photo, later attached email. works fine.

the problem is, crashes if there's no photo taken. idea how can fix this?

here's button code, in case comes handy somehow.

button sendmail = (button) findviewbyid(r.id.sendemail); sendmail.setonclicklistener(new view.onclicklistener() {      @override     public void onclick(view v) {         // todo auto-generated method stub          intent emailintent = new intent(intent.action_send);          emailintent.putextra(intent.extra_email, new string[]{"somemail@mail.com"});         emailintent.putextra(intent.extra_subject, "subject");         emailintent.putextra(intent.extra_text, "body");         emailintent.settype("message/rfc822");         emailintent.putextra(intent.extra_stream, imageuri);         startactivity(intent.createchooser(emailintent, "choose email client"));     } }); 


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -