When user do share image and press cancel the createchooser keep using information from last call ,even when i he does new share still old informations stored there. How to reset intent data when user cancel sharing ??
i am using this code for sharing
private void shareIt() {
uri = Uri.fromFile(imagePath);
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("image/*");
String shareBody = "try this app";
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "social share app");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
sharingIntent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(sharingIntent, "share by .."));
}
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
Uri screenshotUri = Uri.parse(path);
sharingIntent.setType("image/*");
sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
startActivity(Intent.createChooser(sharingIntent, "Share image using"));
use bove code
put this code to manifest
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
You are not update your ImagePath, So all the time intent show same Image for share, update imagePath before call shareIt() method