Hello I have a problem with the onListItemClick Method on a ListFragment.
I have an activity that holds 2 ListFragments. The first one is a sub navigation and the second one shows some content. The sub nafigation werks perfectly fine and the onListItemClick event is invoked when clicked on a list item. But for the second ListFragment, nothing happens. The method is not invoked.
So far I also tried to replace the Listfragment with a Standard Fragment and set the setOnItemClickListener manually. But it is not fired when I click on a list entry. I also tried to test it with a different Listener (e.g onLongItemClick), but nothing happened either.
These are the settings for my listview.
<ListView
android:id ="@+id/mylistview"
android:layout_width ="match_parent"
android:layout_height ="match_parent"
android:divider ="@android:color/transparent"
android:dividerHeight ="10dp"
android:listSelector ="@android:color/transparent"
android:cacheColorHint ="@android:color/transparent"/>
Note, that i replaced the id with the standard “@android:id/list” when using a ListFragment.
Does anybody know what goes wrong here ? Can it be that the other ListFragments gets all the onListItemClick calls and prevents this one from being fired ?
Here is the adapter that is attached to the list:
setListAdapter(new CustomRatingBarListAdapter(mListEntries,
getActivity(), R.layout.content_view_list_layout,
new int[] { R.id.list_item_text1 }, new String[] { TEXT});
Ok, I found the error. It was something complete different.
In fact I had a rating bar as a list item and even tough it did not cover the whole list item it somehow got all the click events.
Changing the visibility to GONE for now solved the problem. So the problem was here the layout of a single list item and not the adapter.