If you use a Cursor instead of an ArrayList (you could copy ArrayListCursor
in to your application to wrap your current ArrayList), then you could use
SimpleCursorAdapter, which allows you map each column to its own view.


On Wed, Jun 24, 2009 at 1:58 PM, Rick <rmanc...@mit.edu> wrote:

>
> Thanks for that example az. Sorry to say it's not quite what I am
> looking for.
>
> I've come across that example in my searching Mark. However, I seem to
> have some difficulty getting it to play nicely with the way the rest
> of the program has been written to this point. I feel confident that
> inflation is the way to go, but just have to get it to gel.
>
> Thanks for all the help.
>
> On Jun 24, 4:20 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> > Rick wrote:
> > > I'm not sure I follow. Below is some sample code:
> >
> > > view.setAdapter(new ArrayAdapter<String>(this,
> > > R.layout.custom_listview, R.id.label, this.titleList));
> >
> > > where titleList right now is an ArrayList of strings.
> >
> > > Are you suggesting to make a second adapter and use that textview in
> > > that?
> >
> > Step 1: Put both TextView widgets in res/layot/custom_listview.xml,
> > formatted however you wish
> >
> > Step 2: Override getView() and either:
> >
> > Step 2a: chain to the superclass, let it inflate
> > R.layout.custom_listview for you, then you do findViewById() on the row
> > to pour in your additional data, or
> >
> > Step 2b: inflate and customize R.layout.custom_listview yourself
> >
> > You can see examples of the 2b scenario by reading the Fancy ListViews
> > series of blog posts linked to from here:
> >
> > http://wiki.andmob.org/samplecode
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com|
> http://twitter.com/commonsguy
> >
> > _Android Programming Tutorials_ Version 1.0 Available!
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to