2017-02-15 16 views

答えて

0

これを試してください。

Glide.with(this) 
      .load(url) 
      .asBitmap() 
      .into(new SimpleTarget<Bitmap>() { 
       @Override 
       public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) { 

       } 
      }); 
0
private SimpleTarget target = new SimpleTarget<Bitmap>() { 
    @Override 
    public void onResourceReady(Bitmap bitmap, GlideAnimation glideAnimation) { 
     // do something with the bitmap 
     // for demonstration purposes, let's just set it to an ImageView 
     imageView1.setImageBitmap(bitmap); 
    } 
}; 

private void loadImageSimpleTarget() { 
    Glide 
     .with(context) // could be an issue! 
     .load(eatFoodyImages[0]) 
     .asBitmap() 
     .into(target); 
} 

出典:あなたがこの方法を試すことができます

0

これを試してみてください(Uri.formFileは()これのトリックで使用):

File b = new File(Environment.getExternalStorageDirectory(), "DCIM/Camera/IMG_20150828_174009.jpg"); 

 Glide.with(MainActivity.this).load(b).error(R.drawable.empty_pic).placeholder(R.drawable.empty_pic).into(image2); 
関連する問題