einnocent wrote:
> My first attempt to post this seems to have failed. This is a second
> attempt.
> 
> I am trying to display a screen filled with data fetched from a
> server. The data, if it were HTML, would look something like the
> following (try to visualize =) ):
> 
> <h1>This Is the Title</h1>
> <p>Here is some pertinent info.</p>
> <p>Below here is a list with ~1-10 items, depending</p>
> <table>
> <tr>
> <td>This first item is neat!</td>
> </tr>
> <tr>
> <td>Looks like we only got two items this time. Who knew?</td>
> </tr>
> </table>
> 
> So I naively tried to put a ListView in a ScrollView. Not only did it
> not work, but I've since read all about why it is bad by the likes of
> such luminaries as Hackborn and Guy (it nullifies the optimizations,
> etc).
> 
> Problem is, the half dozen places that said NOT to do it didn't
> recommend what I SHOULD do instead, excepting one post by Romain Guy
> specifying footer or header use (not suitable in my example, right?).

It is unclear, at this point, what you want this to look like.

I am going to take a random guess and assume that the contents of your
HTML <table> represent two rows in a ListView, and the <h1> and two <p>
are things you want to appear above the ListView.

In that case, use a LinearLayout, and put the things you want above the
ListView above the ListView.

> In other words, it seems like people want to mix a list of items in
> among other text data, getting the benefits of a ListAdapter, but this
> isn't addressed anywhere that I can find.

I have no idea what you mean by this.

If your issue is that you want a ListView with varied contents, not all
coming from a single Adapter, then use a more complicated Adapter. For
example, you can download the source code to my Advanced Android book
off of this page:

http://commonsware.com/AdvAndroid/

(scroll down to the Source Code link)

There, you will find a ListView/Sections project, demonstrating a
ListView with section headers, akin to the preference screens. That
combines several Adapters' worth of data into a single meta-Adapter that
is handed to the ListView.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 0.95 Available!

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

Reply via email to