0

This is extended from the thread:Picasso Images are not loading in Gridview Android

Now the new problem is that the Picasso is not loading the images properly. If i hardcode the image url though, then the image will display (repetitively though).

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

    if(convertView == null) {
        //Inflate the XML based 

Layout
        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = inflater.inflate(R.layout.movies_item, parent, false);
}

//Get the ImageView
ImageView movieThumbnail = (ImageView) convertView.findViewById(R.id.movies_item_thumbnail);

//Load Image into the ImageView
Picasso.with(context).load(movies.get(position).getThumbnail()).into(movieThumbnail);

//When I hardcode the url, the image shows as shown in the screenshot below       
//Picasso.with(context).load("http://image.tmdb.org/t/p/w500/nBNZadXqJSdt05SHLqgT0HuC5Gm.jpg").into(movieThumbnail);
Log.v("Populating", movies.get(position).getThumbnail());

return convertView;
}

I am completely lost. It does not throw any error too. HELP!!!!!!!!

Screenshot

[UPDATE] Please refer to this link for the solution!

OkHTTP and Picasso don't run together

Community
  • 1
  • 1
coffeeak
  • 2,980
  • 7
  • 44
  • 87

2 Answers2

0

Well try using this

movies.get(position).getThumbnail().toString()

and make sure your URL is complete

Rajan Kali
  • 12,627
  • 3
  • 25
  • 37
0

I will give my code try this way.. Picasso.with(ctx).load(String.valueOf(images.get(position))).error(R.drawable.scorpion).into(serve_dish_iv); here variable "images" is ArrayList variable.. Try this way

Picasso.with(context).load(movies.get(position).getThumbnail()).error(R.drawable‌​.defulticon).into(movieThumbnail);

if any images are not available then default image is show.. If any issue please ask me..

Cprk Praveen
  • 129
  • 1
  • 10
  • Picasso.with(context).load(movies.get(position).getThumbnail()).error(R.drawable.defulticon).into(movieThumbnail); – Cprk Praveen Oct 07 '15 at 14:16
  • Finally some progress! The default images are showing. But i don't understand why the image thumbnail urls are not working. The urls are correct and I tried to open them in the browser. They display fine. – coffeeak Oct 07 '15 at 14:20
  • Okay.. If you don't I give suggestion you.. Please once again check your URL.. my think is That URL is not correctly.. – Cprk Praveen Oct 07 '15 at 14:42
  • If you have satisfied with my answer.. please put check mark on this answer.. because our future friends are followed and getting this answer correct way.. – Cprk Praveen Oct 07 '15 at 14:44
  • It was not url problem. I finally found my answer here http://stackoverflow.com/questions/24179665/okhttp-and-picasso-dont-run-together/28251889#28251889 – coffeeak Oct 07 '15 at 14:45