[android-developers] Re: ListView and onItemSelected

2012-11-14 Thread Khunshan Shabbir
listitem = m_adapter.getItem(position); can be listitem = getListAdapter().getItem(position) :P On Thursday, 3 September 2009 02:20:31 UTC+5, danny wrote: > > Not sure what your issue is...but this is what worked for me. > > In main activity init... > final ListView searchResults = (Lis

[android-developers] Re: ListView and onItemSelected

2009-09-04 Thread chrisoz
I will answer my own question here as I finally got it sorted... Hope it can be useful for anybody else. Using the setOnItemSelectedListener and onItemSelected is not needed for this purpose. The solution was in the xml: In the row TextView: android:id="@+id/label" android:layout_width="

[android-developers] Re: ListView and onItemSelected

2009-09-02 Thread chrisoz
Thanks danny, what I am trying to achieve here is to change the background color of the selected list item (list items have a white background colour). Like you I am able to call onItemClick (or rather, onListItemClick), but not onItemSelected. Now, it is not possible to see which list item is se

[android-developers] Re: ListView and onItemSelected

2009-09-02 Thread danny
Not sure what your issue is...but this is what worked for me. In main activity init... final ListView searchResults = (ListView) findViewById (R.id.list_search_results); searchResults.setOnItemClickListener(this); and this DOES get called... @Override public void onI