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.

Tom

--



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)
[ http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/ ]

* My updated rendition (GPL)
[ http://github.com/commonsguy/cw-advandroid/tree/master/ListView/Sections/ ]

* My MergeAdapter, which can be used for this scenario as well (Apache)
[ http://github.com/commonsguy/cwac-merge ]

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

 http://stackoverflow.com/questions/1660417/android-efficientadapter-with-two-different-views 

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
Android App Developer Books:  http://commonsware.com/books.html 


--


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

Hi,

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

Regards,
Raja Nagendra Kumar
www.tejasoft.com
--~--~---------~--~----~------------~-------~--~----~

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
android.provider.Gmail
android.provider.Im
android.provider.Telephony
acquireProvider(Uri)
deleteRow()
lookupProviderNameFromId(int)
ISyncAdapter
IContentProvider
etc....

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/
internal/telephony/callerInfosync...


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

Any help in this regard would be really great!


Thanks,
Shibbs
--~--~---------~--~----~------------~-------~--~----~

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