StickyListHeaders icon indicating copy to clipboard operation
StickyListHeaders copied to clipboard

setOnItemSelectedListener not implemented

Open parahall opened this issue 11 years ago • 1 comments

Hi,

In regular list view there is * Register a callback to be invoked when an item in this AdapterView has * been selected. * * @param listener The callback that will run */ public void setOnItemSelectedListener(OnItemSelectedListener listener) { mOnItemSelectedListener = listener; }

since StickyListHeadersListView not extend ListView but FrameLayout therefore this method not accesable. Could you please add to StickyListHeadersListView.java

public void setOnItemSelectedListener(OnItemSelectedListener listener) {
    mList.setOnItemSelectedListener(listener);
}

parahall avatar Jan 08 '15 09:01 parahall

Hi

I have been struggling with the same issue.

You can access the internal ListView with stickyListView.getWrappedList() and register a listener on it.

This will be the solution

stickyListView.getWrappedList().setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
                @Override
                public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {}

                @Override
                public void onNothingSelected(AdapterView<?> parent) {}
            });

wijnanb avatar Jun 08 '17 14:06 wijnanb