javaandroidlistviewandroid-listview

Add images and additional text to Android listview


I have designed a simple application that will communicate with my desktop computer using UDP to download a list. I have, so far, been able to communicate with the computer and retrieve the list entries and subsequently display them on my Android device using listview. However, the current list is somewhat plain and ugly, so I would like to add various icons to the list. How does one go about doing this? Thanks…


Solution

  • You can easily add images and subtext to a ListView by using an ArrayAdapter, which allows you to add ImageView and additional TextView to your ListView. Both Vogella and Android InterView provide excellent tutorials on doing this; furthermore, the Vogella tutorial also discusses, at length, ‘ListView’ itself and all of the different things that you can accomplish with it:

    http://www.vogella.com/tutorials/AndroidListView/article.html http://www.androidinterview.com/android-custom-listview-with-image-and-text-using-arrayadapter/