-1
GIFファイルを共有しようとしています。私は、ソーシャルネットワーキングのアプリケーションを介して共有したい、私はファイル名に問題があります。私は名前のファイルを取得する方法はありません。これは私のコードです:ファイルをグライドで共有する
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"));
}
});
}
});