I tried sharing the images from my app to other apps but a toast is displayed = "file not sent". not sure what to do. down below I have posted the code that I am using to share image
@Override
public void onWhatEverClick(int position) {
Toast.makeText(this, "Normal click at position: " + position, Toast.LENGTH_SHORT).show();
try {
Upload selectedItem = mUploads.get(position);
final String selectedkey = selectedItem.getKey();
StorageReference imgRef = mStorage.getReferenceFromUrl(selectedItem.getImageUrl());
String url = selectedItem.getImageUrl();
String imageString = url.toString();
URI uri = new URI(imageString);
final Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/jpg");
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(shareIntent, "Share image using"));
}
catch (Exception e)
{
}
}