Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting Intent.ACTION_SEND always return resultCode 0

I'm sharing an image from my application by starting Intent.ACTION_SEND with image msg.setType("image/png") using startActivityForResult(). The call works perfectly and displays the desired activity chooser.

But when I get back to onActivityResult() the resultCode is always 0. To display my UI correctly I need to know if the user sent / shared the picture or cancelled the operation. Is there any way for me to know that?

like image 374
Juhani Avatar asked Mar 04 '26 14:03

Juhani


1 Answers

the resultcode needs to be set in the acticty which u launch to send the image. In the acitivity which is used to send the image set positive result before finishing the activity

like image 105
Varun Avatar answered Mar 07 '26 07:03

Varun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!