问题
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?
回答1:
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) {
}
});
来源:https://stackoverflow.com/questions/18292695/java-android-volley-library-get-a-bitmap-via-imageloader