Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java Android - volley library - get a Bitmap via ImageLoader

I'm doing some examples with volley library for which there is so few docs/examples

public class MainActivity extends Activity {
    private ImageView mImageView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mImageView=(ImageView) findViewById(R.id.imageView1);
        RequestQueue queue = Volley.newRequestQueue(this); 
        ImageLoader imageLoader = new ImageLoader(queue,new BitmapLruCache());
        imageLoader.get("http://s017.radikal.ru/i413/1209/e7/648aa22cb947.jpg", ImageLoader.getImageListener(mImageView, R.drawable.ic_launcher, R.drawable.ic_launcher));
    }

This loads an Image from the url directly into ImageView. But what if I want to crop it before put it on an ImageView?

Can this ImageLoader place image to a Bitmap somehow?

like image 440
user2234594 Avatar asked Nov 30 '22 12:11

user2234594


1 Answers

Do you wanna this?

   imageLoader.get(newsItem.getThumbUrl(), new ImageLoader.ImageListener() {
        @Override
        public void onResponse(ImageLoader.ImageContainer response, boolean isImmediate) {

        }

        @Override
        public void onErrorResponse(VolleyError error) {

        }
    });
like image 88
TeeTracker Avatar answered Dec 04 '22 21:12

TeeTracker