Hi,

I was populating a list with a SimpleAdapter like this:

final List<Map<String, String>> data = someObject.getData();
SimpleAdapter dataAdapter = new SimpleAdapter
                        (this, data, R.layout.listline, from, to);
listView.setAdapter(dataAdapter);
listView.setOnItemClickListener(...);

The listView gets this from the layout.xml:
android:choiceMode="singleChoice" android:clickable="true"

R.layout.listline defines a layout for each line, having 4 TextViews
and some more widgets. Everything works fine so far.

But now I need to use a ListAdapter to populate my list. It was easy
to write a class that implements all those methods required by that
interface, and the resulting List looks exactly the same now. It
performs well on scrolling, changing data, etc. but the lines are not
clickable any more. My onItemClickListener.onClick is never called,
not matter where I tap on my list line (e.g. on one of the TextViews
or on the background of that line). In my implementation, I use
View.inflate to inflate excactly the same xml as the SimpleAdapter
did.

Shouldn't the click behaviour of a list be independant of where data
comes from?

I guess SimpleAdapter does some internal "magic" that I'd need to
perform in my own implementation as well, to make the line clickable.
Can somebody point out what I'm missing? I'd also like to look at the
source code of SimpleAdapter, but I coudn't find it anywhere on
http://android.git.kernel.org/ - maybe I'm just to dumb to look in the
right place. Can somebody point me to that code? (possibly without
forcing me to install git and download the whole code base)

thanks,
Brian
--~--~---------~--~----~------------~-------~--~----~
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