views:

108

answers:

3

I don't now if this title is very clear, but I would like to understand how this is possible : alt text
And how we can have 2 elements on the same row of the listview, and handle different clicks, as the listview deals with handling the click on a child.

Thanks for anyone who could point me in the right direction.

+1  A: 

Anytime that you need anything more than a basic list of text you have to define in an XML file what your list items will look like. They can have anything you want in them when you define them. In your above example you could achieve something similar by defining a list item with two static text items, and two images. You can register listeners on individual components so that when the user taps the left image it opens the left link, and so on.

Here's a tutorial I found on the topic, and there are many more out there that are better.

Just make sure you understand how to re-inflate old items in your list that go out of view, and how to make an adapter for your list items.

Ben Burnett
That's what I thought, I wanted to double check . So I suppose I can handle separate selectors the same way to show that one or the other object is clicked.Thanks guys, that confirms my thoughts.
Sephy
A: 

When you create your ListAdapter you can pass in a layout to use for the List Items. In this layout you can specify any UI objects you wish, int this case Image and Text views.

BrennaSoft
A: 

You should use a GridView rather than a ListView in this case. Check it out here : http://developer.android.com/reference/android/widget/GridView.html

Greg