I have activity with image view and share button, the image retrieved from DB
I want to save the image at first then share it
every things is going fine , the image saved in internal memory and it's going to share but when the other app runs (like whatsapp or messaging) it says file not support
I have push other image to ddms manually and then share is works without any problem !! O.o
I think the problem is from saving the bitmap, even I checked the saved bitmap from the ddms and it was looks good
there is my codes:
save
try {
FileOutputStream out = new FileOutputStream(new File(getFilesDir(), "temp.png"));
imageview.setImageBitmap(b1);
b1.compress(Bitmap.CompressFormat.PNG, 100, out);
out.flush();
out.close();
}
catch (Exception e) {}
share method
private void initShareIntent(String type,String _text)
{
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM,Uri.fromFile(new File(getFilesDir(), "temp.png")));
shareIntent.setType("image/PNG");
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(shareIntent, "send"));
}