Multiple Layouts in a ListView

by Loki117 » Fri, 06 Nov 2009 06:01:58 GMT

Sponsored Links
 Hey Guys,

I am looking for some help around ListViews. I would like to use a
ListView to hold a number of rows of data however in between some of
these rows of data may appear a header indicating a new section of
data types. Can someone tell me have they implemented a ListView that
uses multiple layout types and if so how do you determine which layout
type is being passed back in the convertView in order to make sure you
do not try to recast it to the wrong type.



Multiple Layouts in a ListView

by Mark Murphy » Fri, 06 Nov 2009 06:10:55 GMT

 > I am looking for some help around ListViews. I would like to use a

You can use:

* Jeff Sharkey's original SeparatedListAdapter (GPL)
[ ]

* My updated rendition (GPL)
[ ]

* My MergeAdapter, which can be used for this scenario as well (Apache)
[ ]

Here is a StackOverflow discussion of the techniques for doing it yourself: 

Mark Murphy (a Commons Guy) 
Android App Developer Books: 


Sponsored Links

Multiple Layouts in a ListView

by Loki117 » Fri, 06 Nov 2009 06:45:10 GMT

 Great thanks the StackOverflow thread done the trick I did not know
about those overrides.


Other Threads

1. Speed up emulator starting


Android SDK startup takes more than 2 minutes.. is there a way to
start the emulator faster with any special parameters..

Raja Nagendra Kumar

2. Build Contact "Stand Alone" apk - from Android Contact Source Code?

Hi all,

I have downloaded the full Android source code & pulled out the
contact source into a different folder.

I am trying to create a separate Contacts "stand alone" App using the
existing android contacts source code, once that done I intend to add
some more features ( code ) to contacts source & make a contacts.apk
out of it.

Is it possible?

The problem I faced was, when I pulled the contacts app source code,
there were many internal api calls & Private api references. I tried
to resolve them by including those internal api source code & class
files(available from the android source code) in my project, but there
are still many errors & internal api calls, which I am not sure how to
resolve them like:

import android.os.ServiceManager

Is there a way to solve these internal API issue?

Was there anyone who has successfully extended any of the existing
apps (Contacts, Alaram, calendar...) of android with the help of its
source code, is this approach possible?

I tried to include the "framework_immediates classes.jar" in the
project, but due to duplicate class files present in the project & SDK
it throws the ususal -
UNEXPECTED TOP-LEVEL EXCEPTION: class file already added com/android/

I have been trying to achieve this for the past 2 days, with not much
Can somebody lead me to a correct direction?

Any help in this regard would be really great!


3. BATTERY_CHANGED not being sent for some reason.

4. ListActivity + CheckBox = bug ?

5. Flashing SIM-Locked HTC Dream?

6. Lock screen feature does not work

7. WebView's use of AbsoluteLayout