Reputation: 41
Good day everyone , I want to ask why I can't create SwipeRefresh on RecycleView. It works fine on Marshmallow only , it destroys the app in another version here is Screenshot of logcat
Upvotes: 0
Views: 234
Reputation: 38223
From your logcat:
android.app.Fragment
)getContext()
method, which is not present on earlier platforms.getContext()
returns a different thing from getActivity()
.Use getActivity()
instead of getContext()
.
It's worth noting that this has nothing to do with the SwipeRefreshLayout
itself. You just used wrong method call in the OnRefreshListener
callback.
Upvotes: 1