4

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?

2
  • You should get it crop it and then reassign it to the bitmap Commented Aug 17, 2013 at 20:02
  • Allright, I just don't really understand how. I put my url for downloading in the same method that sets it to and ImageView. Which means I can't do anything in between Commented Aug 17, 2013 at 20:05

1 Answer 1

20

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) {

        }
    });
Sign up to request clarification or add additional context in comments.

2 Comments

but how do I load this into bitmap?
in response of ImageContainer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.