Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev branch - null pointer exception on fastscroller setrecylcerview #66

Closed
zosocanuck opened this issue Apr 11, 2016 · 1 comment
Closed

Comments

@zosocanuck
Copy link

Hi,

I"m using dev branch and following your sample code (from FragmentExpandableSections.java), and running in an API 23 simulator:

java.lang.NullPointerException: Attempt to invoke virtual method 'void eu.davidea.fastscroller.FastScroller.setRecyclerView(android.support.v7.widget.RecyclerView)' on a null object reference

This is the relevant code in initializeRecyclerView():

FastScroller fastScroller = (FastScroller) getActivity().findViewById(R.id.fast_scroller);
fastScroller.setRecyclerView(mRecyclerView);
//Add FastScroll to the RecyclerView, after the Adapter has been attached the RecyclerView!!!
mAdapter.setFastScroller(fastScroller,
R.color.colorAccent, (HomeScreen) getActivity());

Any ideas?

@davideas davideas added the bug label Apr 11, 2016
@davideas
Copy link
Owner

@zosocanuck, probably it doesn't find the FastScroller with id R.id.fast_scroller;
I'll add a check on the FastScroller object.

Thanks to report it, I will fix it on next SNAPSHOT release.
However, be sure to set a non-null object when mAdapter.setFastScroller() is invoked.
I will have to throw an IllegalArgumentException anyway if a null FastScrolled is specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants