What's the way to create a listview with images on the left side and text right after it? (Note: the images were previously downloaded from the Net) Thanks in advance!
Here's a complete sample code Lazy load of images in ListView. You can reuse it.
If you have new items in the list you just call adapter.notifyDatasetChanged()
and ListView
will redisplay all items including the new ones.
The getView()
method in adapter inflates item.xml and displays real data in it. You need to start with some basic ListView
tutorial, such as the one at Android Series: Custom ListView items and adapters.
A ListView item can have it's own custom layout. When you create your adapter for the ListView you can pass in the layout id to the Adapter constructor. See SimpleAdapter and ArrayAdapter.
=> You will have to extend an Adapter and implement getView()
to property set the image+text.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With