I'm unable to share image to social media
when i clicked on share button.
It showed the Toast
File format not supported
public void onBindViewHolder(final ViewHolder holder, int position) {
upload = uploads.get(position);
holder.textViewName.setText(upload.getName());
final String imageUrl=upload.getUrl();
Glide.with(context).load(imageUrl).into(holder.imageView);
final Uri imageUri=Uri.parse("https://firebasestorage.googleapis.com/v0/b/memories-project.appspot.com/o/uploads%2FnCfBZThQykf3Ur9oNzHyEHS1DEp2%2F45007?alt=media&token=9ae17594-13ff-40f6-98f9-aff80ab2fdf4");
holder.shareImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(context,imageUrl,Toast.LENGTH_SHORT).show();
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_STREAM,imageUri);
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
try {
context.startActivity(Intent.createChooser(shareIntent, "Share image File"));
} catch (android.content.ActivityNotFoundException ex) {
}
}
});
}
I stored images to firebase
.
Now i get the link from firebase and parse into uri but i don't know why this is showing.
I hardcoded the URL just for testing purpose.
For WhatsApp:
File Format not supported
For Instagram:
Image Unable to load
For Facebook :
Showed nothing means no Toast or anything(Just Showed the status bar)
For Messenger:
Not opened