-3

I am using code below for loading image via picasso in list view

    ListAdapter adapter = new SimpleAdapter(
            tampil_semua_laporan.this, list, R.layout.list_item,
            new String[]{konfigurasi.TAG_TANGGAL,konfigurasi.TAG_JUDUL,konfigurasi.TAG_DESKRIPSI},
            new int[]{R.id.tanggal, R.id.judul, R.id.deskripsi});

    listView.setAdapter(adapter);

Please Help and thanks

Rishabh Saxena
  • 1,765
  • 15
  • 26
Ones
  • 1
  • 2
  • You need to read about the learn more about adapter. – Frandall Sep 12 '18 at 02:19
  • You need to extend your adapter and override getView() to made the adpater to use your desired image loader to load image. My answer here may help: https://stackoverflow.com/questions/51268953/how-to-display-the-data-of-an-external-database-in-the-listview/51298768#51298768 – i_A_mok Sep 12 '18 at 03:18
  • 1
    Possible duplicate of [Using Picasso library with ListView](https://stackoverflow.com/questions/23120238/using-picasso-library-with-listview) – Zankrut Parmar Sep 12 '18 at 04:19

1 Answers1

0

set picasso into getView method of your simpleAdapter. like below -

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

        // set here
       Picasso.with(mContext)
                        .load(image[position]) //set your image id position here
                        .transform(new RoundedCornersTransform())
                        .placeholder(R.drawable.placeholder)
                        .into(Imageview);

        return convertView;
    }