I use the following code to share:
Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.share_text)); sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file)); sendIntent.setType("image/png"); startActivityForResult(Intent.createChooser(sendIntent, getResources().getString(R.string.share_via)), REQUEST_SHARE_RESULT);
And I want to check the result for this intention in my onActivityResult() function. But it always returns Activity.RESULT_CANCELED . Even sharing has been successful. Why???
source share