android - ListView Adapter with multiple Item layouts -


i'm looking @ adding listview android application thumbnail image. thumbnail on left , text on right.

is there way of populating list view seperate xml files, example, have separate xmls austria, uk, usa etc , add them listview?

the reason ask is, plan reuse individual countries multiple times, in, shown in z again continent etc.

if possible, example of how done or link tutorial etc?

thanks

do want separate .xml files? or want reuse 1 .xml file , replace content?

if want separate .xml files (meaning multiple different views in adapter) take @ adapters methods:

  • getviewtypecount() - returns how many different view layouts have
  • getitemviewtype(int pos) - returns correct view type id position

with these methods can specify number of different types in adapter, , load different layout files depending on type.

you example have adapter supporting multiple layouts. (e.g. 1 item being actual item, other 1 being separator between items)

for more specific information, please take @ great tutorial:

http://android.amberfog.com/?p=296


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -