When downloading pictures from the Internet using the picasso library, for some time the pictures are loaded as they should, but at some point picasso stops working and instead of the unloaded pictures there are still stubs. What can be the reason? My adapter:

 public class CustomListAdapter extends BaseAdapter { Context ctx; LayoutInflater lInflater; ArrayList<Item> objects; CustomListAdapter(Context context, ArrayList<Item> items) { ctx = context; objects = items; lInflater = (LayoutInflater) ctx .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Override public int getCount() { return objects.size(); } @Override public Object getItem(int position) { return objects.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; if (view == null) { view = lInflater.inflate(R.layout.item, parent, false); } Item p = getProduct(position); ((TextView) view.findViewById( R.id.textView4)).setText(p.price); ((TextView) view.findViewById(R.id.textView6)).setText(p.brand); ((TextView) view.findViewById(R.id.textView5)).setText(p.model); ImageView img= view.findViewById(R.id.imageView1); Picasso.with(ctx).load(p.image).fit().into(img); return view; } Item getProduct(int position) { return ((Item) getItem(position)); } } 
  • Okay, it’s understood that the problem is probably that on my phone at some point the memory runs out. Tell me pzhl options for optimization. Or maybe you can make the pictures easier? - Dmitry
  • Okay, it’s understood that it’s probably going away with a bruise somewhere. Because only 89 pictures, each ~ 30kb each (i.e., all by about 3mb). The process at the same time eats 20mb and is obviously ready to eat more, because does not swing further. The shoal should be on the surface, help) - Dmitry

1 answer 1

Understood, everything really turned out to be simple and does not concern either the adapter or even the application itself. I have a server on Flask sticking out through ngrok. As it turned out, ngrok supports only 20 connections per minute for free. ))