2
我试图下载功能添加到我的应用程序使用滑翔库从他们网址立即下载图片“米这是我保存的代码图片中的设备存储,但都不尽如人意 正常工作与的Android 5.0.1和6.0.1但在另一个Android版本不顺利将照片保存在设备[滑翔库]
Toast.makeText(Pop.this, "Please wait ...", Toast.LENGTH_LONG).show();
new AsyncTask<FutureTarget<Bitmap>, Void, Bitmap>() {
@Override protected Bitmap doInBackground(FutureTarget<Bitmap>... params) {
try {
return params[0].get();
// get needs to be called on background thread
} catch (Exception ex) {
return null;
}
}
@Override protected void onPostExecute(Bitmap bitmap) {
if(bitmap == null) return;
MediaStore.Images.Media.insertImage(getContentResolver(), bitmap, "Art_"+System.currentTimeMillis(), "Beschrijving");
}
}.execute(Glide.with(getApplicationContext()).load(url).asBitmap().diskCacheStrategy(DiskCacheStrategy.SOURCE).into(width, height));
请帮我
感谢这么muuuuuuuuuuuuuuuch – pic
非常感谢,但是当图像保存质量差时 – pic
默认值位图格式由Glide是RGB_565。看看这个[link](https://inthecheesefactory.com/blog/get-to-know-glide-recommended-by-google/en) – anandwana001