PagingListView
PagingListView copied to clipboard
return of listView.getAdapter()
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?
Hi!! Did you try something like this:
if (headerViewAdapter.getWrappedAdapter() instanceof MyPagingAdaper) {
MyPagingAdaper adapter2 = (MyPagingAdaper) headerViewAdapter.getWrappedAdapter();
}