0

I want to create a journal that appears as a list in a ListView. The list should be able to have a text entry or an image for each row. Now, I have these entries (text and image) in a database. I just want to know how to create a list adapter which can have these entries. From the examples I have seen, the list adapters all have only one data type. I want my adapter to have data type image or text. Please Help! Been searching for 3 hours now.

Andro Selva
  • 53,910
  • 52
  • 193
  • 240
Ama
  • 195
  • 1
  • 1
  • 9

1 Answers1

0

To show images in some listItems and text in others, declare both an ImageView and a TextView in the listitem xml, and hide/show one of them with View.setVisibility(...), where you bind the content. For examples of multiple children in a listItem, refer to other Nik's answer

Marmoy
  • 8,009
  • 7
  • 46
  • 74