As Romain said, top-level View has to be Checkable. A solution could
be to make a custom container implementing Checkable interface, then
use that container as top-level View for your row. Overriden methods
just call analog methods in Checkable item inside the container.
Example:
public class
Does anyone know if this thread ended well? I attempting to create a fancy
list with a multiple selection (in 1.6).
The following code give seemingly random results using a SimpleCursorAdapter
...
@Override
protected void onListItemClick(ListView l, View v, int position, long
id) {
OK. I am an idiot.
This was not working for me because I had left-over code in onCreate from
something else I tried:
//listView.setItemsCanFocus(false);
//listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
In the process I learned an awful lot from Mark Murphy's examples in
@Romain-
Thanks for responding. setChoiceMode is set to Mutiple choice. But it
doesnt check the row. Thats why I am manually trying it.
That's because the top-level View in your item has to be Checkable.
It's a current limitation of ListView :(
On Feb 16, 4:12 am, Mark Murphy
Shams wrote:
Hello,
I have a custom multi-select listview with two lines per row and a
checkbox in the first line. When I click on the checkbox, the checbox
does not get checked. But the list items get checked/ unchecked. I
want to check the checkbox corresponding to the row I clicked. If I
Do not handle the checked state yourself. ListView recyles the view
which can cause trouble. Lookup setChoiceMode() instead and refer to
the ApiDemos for examples.
On Sun, Feb 15, 2009 at 5:42 AM, Shams shammi.theod...@gmail.com wrote:
Hello,
I have a custom multi-select listview with two
6 matches
Mail list logo