It has nothing to do with extending ArrayAdapter. It must be because your list items contain focusable elements.
On Mon, Jun 8, 2009 at 10:04 AM, xinit<[email protected]> wrote: > > Hi, > > I am a bit puzzled, because it seems that if I extend ArrayAdapter > then onListItemClick will not fire. > For example: > > //init 2 arrays that I will parse into my own ArrayAdapter that > String [] Artist = {"test 1", "test 2", "test 3", "test 4", "test > 5"}; > String [] Song = {"test 1", "test 2", "test 3", "test 4", "test 5"}; > > MyDoubleTextViewAdapter dta = new MyDoubleTextViewAdapter(this, > R.layout.row, Artist, Song); > > setListAdapter(dta); > > //This code will display the ListView pefectly. However if I want the > items in the list to be clicked then I should overide the > onListItemClick > > protected void onListItemClick(ListView l, View v, int position, long > id) { > Log.d("LOG", "FIRE !!!! " ); > super.onListItemClick(l, v, position, id); > > } > > > Basically the onListItemClick never fires. > > If I change the code so that it does not extend ArrayAdapter and pass > through one Array object > > setListAdapter(new ArrayAdapter<String>(this, > android.R.layout.simple_list_item_1, Artist)); > > Then the onListItemClick Works ! > > So what is the problem with onListItemClick and extending > ArrayAdapter ?? > > > Thanks > > > -- Romain Guy Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" 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-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

