3

i have a problem with picasso library.

I have a Navigation Drawer with a View Pager, and in View Pager i load images from drawable folder.

I have an array of strings like this

public static final String [] IMAGES = 
{
        "drawable://" + R.drawable.aa12, 
        "drawable://" + R.drawable.acr, 
        "drawable://" + R.drawable.ai_l96a1,
        etc.
}

and this is how I try to load images:

Picasso.with(mContext).load(Constants.IMAGES[position]).placeholder(R.drawable.ic_stub).into(imageView); 

the problem is that in my ViewPager it shows me only the ic_stub image.

Did somebody know why ?

ghita
  • 2,746
  • 7
  • 30
  • 54

1 Answers1

8

Try using a integer array

    int[] image_array = new int[] { R.drawable.aa12, R.drawable.acr,
            R.drawable.ai_l96a1, etc };

And load using

Picasso.with(mContext).load(image_array[position]).placeholder(R.drawable.ic_stub).into(imageView);
George Thomas
  • 4,566
  • 5
  • 30
  • 65