Hot questions for Using Glide in gridview

Question:

I have simple gallery inside my Dialog, all it works good but for now when I have some photos and I need to scroll view it all process doesn't works smoothly. I read that good practice to do that is using Glide lib so I try to do that using code :

Glide.with(mContext)
    .load(listFiles.get(position).toString()) //path to picture
    .into(iv); 

but it doesn't work for me.

For now I do it this way and like I said it works but not smoothly

GridView:

   @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        if(convertView == null)
        {
            convertView = LayoutInflater.from(mContext).inflate(R.layout.my_grid, parent, false);
        }

        ImageView iv = (ImageView) convertView.findViewById(R.id.imageView);
    //setting different width and height for different screen sizes
        Bitmap compressed = decodeScaledBitmapFromSdCard(listFiles.get(position).toString(),mContext.
                getResources().getInteger(R.integer.width),mContext.getResources().getInteger(R.integer.height));

        ExifInterface exifInterface=null;
        try {
            exifInterface = new ExifInterface(listFiles.get(position).getAbsolutePath());
        } catch (IOException e) {
            e.printStackTrace();
        }
//rorating bitmap
        Bitmap rotate = delayedMessageService.rotateBitmap(compressed,exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION,
                ExifInterface.ORIENTATION_NORMAL));
        iv.setImageBitmap(rotate);
        return convertView;
    }

What I am doing wrong and how it should look ?


Answer:

Try replacing this

Glide.with(mContext)
    .load(listFiles.get(position).toString()) //path to picture
    .into(iv);

with this

Glide.with(mContext)
    .load(listFiles.get(position).getAbsolutePath()) //path to picture
    .into(iv);