Use PullToRefreshExpandableListView in fragment

I used the library to view the list for updates in the Snippet, and this is a very good library: https://github.com/chrisbanes/Android-PullToRefresh

Now I want to use PullToRefreshExpandableListView . I looked at the sample code and explained the activity very well. Now I want to use it in the Fragment. But I have a problem. Below I write the code of some parts in the Activity, which is executed by the publisher of the library, and my codes for Fragment

Source code for using PullToRefreshExpandableListView in action:

 class PullToRefreshExpandableListActivity extends ExpandableListActivity { //created mAdapter (SimpleExpandableListAdapter) //inflated mPullRefreshListView (PullToRefreshExpandableListView) //and setListAdapter(mAdapter); } 

Everything is good!

and in my code

A fragment class has been created, the onCreateView method, an inflated PullToRefreshExpandableListView created by mAdapter, as described above. But when I want to install the adapter, there is my problem :(

Code:

 mPullRefreshListView.setAdapter(mAdapter); 

Compilation Error:

 The method setAdapter(ListAdapter) in the type PullToRefreshAdapterViewBase<ExpandableListView> is not applicable for the arguments (SimpleExpandableListAdapter) 

So, if you know how to use PullToRefreshExpandableListView in Fragment, please help or write how to install the adapter.

thanks

+4
source share

All Articles