Je suis en train de partager le fichier GIF. Je veux le partager via les applications de réseaux sociaux, j'ai un problème avec le nom du fichier. Je ne sais pas comment obtenir le fichier de noms. Ceci est mon code:Partager le fichier en utilisant Glide
llsetwallpapers.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// set as wallpapers
lt.setText("Please Wait ...");
lt.setTranslationY(100);
lt.show();
Glide.with(getApplicationContext())
.load(url)
.asBitmap()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation<?super Bitmap> glideAnimation) {
File file = new File file = new File(getApplicationContext().getExternalCacheDir() , namefile)
file.setReadable(true);
Uri uri = Uri.fromFile(file);
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("image/gif");
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(shareIntent, "Share with"));
}
});
}
});