I just created an Activity where the user after filling some fields and clicking a button the code that is being executed is :
Intent sendEmail = new Intent(android.content.Intent.ACTION_SEND);
/* Fill it with Data */
sendEmail.setType("plain/text");
sendEmail.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"mail@mail.com"});
sendEmail.putExtra(android.content.Intent.EXTRA_SUBJECT, txtName.getText().toString());
sendEmail.putExtra(android.content.Intent.EXTRA_TEXT,
"name:"+txtName.getText().toString()+'\n'+
"Email ID:"+txtMail.getText().toString()+'\n'+
"Product link:"+'\n'+image);
/* Send it off to the Activity-Chooser */
startActivity(Intent.createChooser(sendEmail, "Send mail..."));
What I want to do now is , after the user has been prompted to choose an e-mail application to send the e-mail :
If the user denied to send the e-mail by clicking somewhere else on the screen , so the "choose e-mail sender" disappeared , i would like to display him a message pop-up about the process that he should follow instead.
If the user successfully chose e-mail application and finally sent the e-mail , after returning to the previous activity i would like it to finish.
Can anyone help guys?
Thanks in advance.