【发布时间】:2017-02-13 09:16:11
【问题描述】:
我正在使用“Glide”将图像从服务器加载到 ImageView。我想知道是否可以从图像视图本身中提取该 URI。
ImageView contentImage = (ImageView) findViewById(R.id.contentImage);
........
Glide.with(getApplicationContext()).load(contentImageUrl)
.crossFade()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(contentImage);
我的目标是在 Imageview 中分享图像。 如何使用 Glide 获取 imageview 上的 URI?
Uri uri = ??????????????
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("image/*");
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(shareIntent, "Share Image"));
【问题讨论】:
-
您可以从文件路径获取图像 uri。这还不够吗?