【发布时间】:2019-01-18 10:19:30
【问题描述】:
如何将 ImageView 转换为文件 imageFile
伙计们,
我的 Android 版本有问题 > 24
我需要使用 FileProvider,但是我的图像在 ImageView 中
我需要获取 imageview 图像,然后使用文件提供程序,然后我就可以使用图像了。
ImageView ivImage = (ImageView) findViewById(R.id.imgFullscreen);
if (Build.VERSION.SDK_INT >= 24)
{ //I'm working here
Uri bmpUri =
FileProvider.getUriForFile (this, "com.xxxxx.fileprovider", newfile);
}else
{
Uri bmpUri = getLocalBitmapUri(ivImage);
}
【问题讨论】: