You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I add a header to the ListView by code e.g: PinnedHeaderListView listView = (PinnedHeaderListView) view.findViewById(R.id.pinnedListView); LinearLayout header1 = (LinearLayout) inflater.inflate(R.layout.menu_left_header_profile, null); listView.addHeaderView(header1);
the position / section in onSectionClick/onItemClick is invalid....
In PinnedHeaderListView.OnItemClickListener you do not take into account the numbers of headers added to the ListView
rawPosition in public void onItemClick(AdapterView<?> adapterView, View view, int rawPosition, long id) contains the number of rows and headers.
When I add a header to the
ListView
by code e.g:PinnedHeaderListView listView = (PinnedHeaderListView) view.findViewById(R.id.pinnedListView); LinearLayout header1 = (LinearLayout) inflater.inflate(R.layout.menu_left_header_profile, null); listView.addHeaderView(header1);
the position / section in
onSectionClick/onItemClick
is invalid....In
PinnedHeaderListView.OnItemClickListener
you do not take into account the numbers of headers added to theListView
rawPosition
inpublic void onItemClick(AdapterView<?> adapterView, View view, int rawPosition, long id)
contains the number of rows and headers.I fix it by add line:
rawPosition -= ((ListView) adapterView).getHeaderViewsCount();
in:
The text was updated successfully, but these errors were encountered: