1

Before Marking it duplicate please read it below. This question was earlier asked around 4-5 years ago.

I have gone through this question on stack. But solution was not given so far so I just wanted to know anyone found any solution for this.

Question is:

How to check if a user successfully completed a share intent or he has cancelled the operation? For instance if a user wanted to share an app via Facebook or gmail, so will ACTION_SEND action after successfull share intimate back to my current app?

Note: Please don't give answers for how to create share intent or onActivityResult .

 @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == RESULT_OK) {
            Toast.makeText(this,"Successfully Sharing", Toast.LENGTH_SHORT).show();

        }}

But this Toast is never occurring.Please suggest me any solution for this.

Community
  • 1
  • 1
Preetika Kaur
  • 1,991
  • 2
  • 16
  • 23
  • Did you read the accepted answer on the question you linked? – 0xDEADC0DE Nov 11 '16 at 07:33
  • ITs the same try to use onActivityResult which is not happening I have checked. – Preetika Kaur Nov 11 '16 at 07:34
  • 1
    Then you should tell us which app the user choosed that failed to give a respones. Android version. Manufacturer. Device model. – greenapps Nov 11 '16 at 08:37
  • I have tried with it Micromax with MArshmallow version, HTC with KITKat version and they are returning nothing after sharing. I tried to share on gmail and slack , content was shared but there is no response in onActivityResult method as result =0 is returning everytime. @greenapps – Preetika Kaur Nov 11 '16 at 08:51
  • `as result =0 is returning everytime` ??? Where do you see that result? You said that onActivityResult was not triggered. So i wonder what happens instead. There is no `result`parameter for onActivityResult. – greenapps Nov 11 '16 at 08:54
  • The function will definitely trigger as we are using startACtivityforREsult to share the intent. but the parametrs what it is returning checked with Log . I mentioned that Toast is never occuring as result=0 is returning always. @greenapps – Preetika Kaur Nov 11 '16 at 09:10

0 Answers0