Android snippet check sends post completion (android show dialog on successful mail sending)

I have a snippet. when the button is clicked, it sends the mail, but I dont know when the mail sends success, after I demonstrate the success of the dialog. my code is sending:

 //Intent action send
        Intent email = new Intent(Intent.ACTION_SEND);
        email.putExtra(Intent.EXTRA_EMAIL,
                       new String[]{to});
        email.putExtra(Intent.EXTRA_SUBJECT,
                       "bbbbb");
        email.putExtra(Intent.EXTRA_TEXT,
                       "AAAAAAA"));

        //need this to prompts email client only
        email.setType("message/rfc822");
        getActivity().startActivity(Intent.createChooser(email,
                                                         "Send mail..."));

      

I need to show a dialog when sending mail successfully. Please help me. thank

+3


source to share


1 answer


There seems to be no good solution for this.

The "normal" way is to use startActivityForResult()

your intent when dispatching, but Intent.ACTION_SEND gives no output ( documentation ), so that won't work either. See this question .



The only way to do it for sure is to make your own activity to send email and return the result.

0


source







All Articles