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

NullPointerException when expanding item with autoscroll #492

Closed
ukevgen opened this issue Nov 16, 2017 · 4 comments
Closed

NullPointerException when expanding item with autoscroll #492

ukevgen opened this issue Nov 16, 2017 · 4 comments

Comments

@ukevgen
Copy link

ukevgen commented Nov 16, 2017

Hi guys! eu.davidea:flexible-adapter:5.0.0-rc2
Fatal Exception: java.lang.NullPointerException
at eu.davidea.flexibleadapter.SelectableAdapter.getFlexibleLayoutManager(SelectableAdapter.java:216)
at eu.davidea.flexibleadapter.FlexibleAdapter$13.handleMessage(FlexibleAdapter.java:5020)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4950)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:997)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:764)
at dalvik.system.NativeStart.main(NativeStart.java)

@ukevgen
Copy link
Author

ukevgen commented Nov 16, 2017

What can it be?

@davideas
Copy link
Owner

@ukevgen, investigated that you are making an expand operation, and the recyclerView is null so that cannot retrieve the layoutmanager to calculate the autoscroll, but is not supposed to be null! what exactly where you doing before or for the expand?

Next time describe the situation and the steps to reproduce it.

@ukevgen
Copy link
Author

ukevgen commented Nov 17, 2017

@davideas Unfortunately I have only crash from fabric (

@davideas
Copy link
Owner

davideas commented Nov 18, 2017

@ukevgen, ah ok not very helpful, look:
I might check the nullity of RV, but lot of functions depends by it: autoscroll, scroll animations, span count, show headers and sticky headers, the smooth scroll. It means that RV can't be null otherwise it is an oxymoron, these events cannot exist without RV.

The trigger is in this line: FlexibleAdapter.java:5020 of RC2 version, which comes from an expand operation, I will do the check of nullity only in that point.
I try to give an hypothesis from a combination of factors: maybe the user expanded an item, phone was quite slow in that moment and the handler, that executes the scroll in post with 150ms delay, found the RV null caused by a closure of the activity or similar. Sure that is rare.

@davideas davideas changed the title NullPointerException NullPointerException when expanding item with autoscroll Nov 18, 2017
@davideas davideas added this to the 5.0.0-rc4 milestone Dec 6, 2017
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