http://github.com/coomar2841/PTracker/blob/master/res/drawable-mdpi/list_view_selector.xml
Set this selector as the background for your item layouts. On Wed, Oct 20, 2010 at 11:51 AM, Hendrik Greving <[email protected]>wrote: > Hmm. I tried ListView... > lv.setOnItemSelectedListener(AdapterView.OnItemSelectedListener() .... > > It seems the callback isn't even called for my ListView. I've also > experimented with <selection> .xml file and setting this as a background for > a View to bind to the SimpleCursorAdapter. I don't know if this is supposed > to work either. I thought the first way (setOnItemSelectedListener) is > supposed to work, actually.. > > > ----- Original Message ----- From: "Kumar Bibek" <[email protected]> > To: "Android Developers" <[email protected]> > Sent: Tuesday, October 19, 2010 11:16 PM > Subject: [android-developers] Re: ListView setOnTouchListener > > > You should use the selectors for a list item and whenever you want to > set a selection, call the listview's method for that. Doing it on > touch, has a few bad effects, which are difficult to handle, or > atleast you would need a few lines of code to handle specific > gestures. > > On Oct 20, 10:41 am, "Hendrik Greving" <[email protected]> wrote: > >> I have a ListView and a database cursor which I set with setListAdapter. >> The >> adapter is a SimpleCursorAdapter which takes a xml description for the >> ListView items. How can I set a onTouch handler for every item, in order >> to >> highlight when it's being touched? >> > > -- > 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]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- > 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]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Kumar Bibek http://techdroid.kbeanie.com http://www.kbeanie.com -- 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

