earl cabanig earl cabanig - 1 year ago 102
Android Question

Android Blurry image

I have an image saved in my database which is perfectly fine I am able to retrieve it, but the problem is that the image quality definitely has been lowered.

This is my code

String server_url = ""+user_id;

ImageRequest imageRequest = new ImageRequest(server_url,
new Response.Listener<Bitmap>() {
public void onResponse(Bitmap response) {
}, 50, 50, ImageView.ScaleType.CENTER_CROP, null, new Response.ErrorListener() {
public void onErrorResponse(VolleyError error) {
Toast.makeText(User_nav.this,"Something went wrong", Toast.LENGTH_SHORT).show();



private static UserImageSingleton mInstance;
private RequestQueue requestQueue;
private static Context mCtx;
private UserImageSingleton(Context context){
mCtx = context;
requestQueue = getRequestQueue();


public RequestQueue getRequestQueue(){
requestQueue = Volley.newRequestQueue(mCtx.getApplicationContext());
return requestQueue;
public static synchronized UserImageSingleton getInstance(Context context){
mInstance = new UserImageSingleton(context);
return mInstance;
public <T> void addToRequestQue(Request<T> request){

This is the activity with the imageView

Answer Source

I think the problem could be, that your max size is set to 50.

}, 50, 50, ImageView.ScaleType.CENTER_CROP, null, new Response.ErrorListener() {

You could use a higher value for the size. If you set those two values to zero there will be no scaling. I hope that solves the problem.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download