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. ListViews Columns instead of rows

Hi,

I'm trying to create a list of clickable items that will go to the
side instead of on the next line. (I was thinking I want a listview)

For example I want to do a menu bar like this:

MenuItem1 MenuItem2 MenuItem3 MenuItem4
---
Some Text/Menu Items as well
----

However when ever I do a list view each item goes on its own line like this

"MenuItem1"
"MenuItem2"
"MenuItem3"

Any suggestions on how to do this?


Dave Germiquet

-- 

2. How to expose methods of an application to another application

Hello,
         Is there any way to expose the methods of one application to
another application in android.
Suppose that I have written a slider for one application and if i want
to use the same slider in some other application, How can I do it
without copying the source.(Both the applications are installed on the
device).

thanks
Dantu

-- 

3. VOOT

4. 鈥淔ailed to find provider info for android.server.checkin 鈥??

5. Moto Droid ADB Drivers no longer work after HTC Evo was used.

6. How to capture game screens on device

7. Absolute pointing HID device on Android-x86