Just a small update, just in case some else has the same problem... I finally found the source code at http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/SimpleAdapter.java;hb=HEAD (no idea why I did not find it before), and there is nothing inside that should have an impact on the click behaviour.
So there muste be something wrong in my code. On 13 Mai, 20:24, "[email protected]" <[email protected]> wrote: > 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 > onhttp://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 [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 -~----------~----~----~----~------~----~------~--~---

