PagingListView icon indicating copy to clipboard operation
PagingListView copied to clipboard

return of listView.getAdapter()

Open ludiaz opened this issue 9 years ago • 1 comments

Hi Friend,

This work is very cool. Congratulations. I have a little problem here, and i think that you can help-me. When i use the listView.getAdapter(), why the return is a HeaderViewListAdapter, when i expected my personalized paging adapter? What is the way for i get my own paging adapter?

I used the code:

listView.setOnItemClickListener(listViewOnItemClickListener);

And inside a OnItemClickListener:

public void onItemClick(AdapterView<?> parent, View view, int position, long id) { try{ PagingListView listView = (PagingListView)parent; MyPagingAdapter adapter = (MyPagingAdapter) listView.getAdapter(); }catch(Exception e){ e.printStackTrace(); } }

This catch a ClassCastException. Can you help-me?

ludiaz avatar Aug 30 '15 21:08 ludiaz

Hi!! Did you try something like this:

if (headerViewAdapter.getWrappedAdapter() instanceof MyPagingAdaper) {
     MyPagingAdaper adapter2 = (MyPagingAdaper) headerViewAdapter.getWrappedAdapter();
}

nicolasjafelle avatar Aug 31 '15 19:08 nicolasjafelle