I have a ListView and every item in this listview contains a gridview and a header textview. Now I want to recognize when the user clicks anywhere on the whole item, so I tried to set an onItemClickListener. Unfortunately this doesn't seem to work because I didn't get the debug log I added to the click method.
My ListView looks like the following
<ListView
android:id="@+id/listview_previous_issues"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:layout_marginBottom="@dimen/article_separator_margin_topbottom"
android:divider="@null"
android:dividerHeight="0dp" />
And the GridView of the list items are this:
<GridView
android:id="@+id/read_news"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:numColumns="auto_fit"
android:columnWidth="@dimen/settings_and_issues_read_issues"
android:stretchMode="columnWidth"
android:verticalSpacing="@dimen/paddingSmall"
android:horizontalSpacing="@dimen/paddingSmall"
android:listSelector="#00000000"
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"/>
Update: The call of onItemClickListener
mIssueList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Log.d("debug", "Klicke auf Ressort mit der Id " + pRessorts.get(position).mRessortId);
//Setze die Ressort-ID welche Topnews angezeigt werden
SharedPreferenceHelper.setLongForKey(Constants.PREFS_SHOWN_TOPNEWS_ID, pRessorts.get(position).mRessortId);
//Refreshe die Ansicht
mContext.refresh();
}
});
I think that the GridView is getting the click event instead of the listview, but I'm not sure if this is correct. Can anyone point out what I have to do to get my clickevents at the listview?