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