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 with null data in adapter #17
Comments
Can confirm. This also applies when a using a filter with no results. |
Fixed in master, please close. |
It seems still broken to me - It fails with same (similar) stacktrace when trying to use it with empty filtered adapter. I am using your lib via compile 'xyz.danoz:recyclerviewfastscroller:0.1.0' in gradle. |
Use the new 0.1.1 and report back ;) |
This fixes the issue, thank you for fast response :) |
@Komoi may I ask you what you did because I still get a crash on fastScroller.setRecyclerView() Layout: https://github.com/Maxr1998/MaxLock/blob/master/app/src/main/res/layout-v14/fragment_appslist.xml Don't mind the outcommented lines, they are no comments in my local sources.. |
@Maxr1998 I actually implemented fast scroll without indicator, it seemed to hard to implement if fully for me, I got lost in examples explaining use of indicators. I checked your code and your problem might be unrelated to this issue and I really cant help you since I do not fully understand it. Is your backtrace similar as timothyjc's? Good luck with your project :) |
Thanks for looking into it :) @danoz73 please close this issues as it's fixed. |
My data in my adapter is empty when the view is loaded and I get the following exception.
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewParent android.view.View.getParent()' on a null object reference
at android.support.v7.widget.RecyclerView.getChildViewHolder(RecyclerView.java:2567)
at xyz.danoz.recyclerviewfastscroller.calculation.progress.VerticalLinearLayoutManagerScrollProgressCalculator.calculateScrollProgress(VerticalLinearLayoutManagerScrollProgressCalculator.java:29)
at xyz.danoz.recyclerviewfastscroller.AbsRecyclerViewFastScroller.onLayout(AbsRecyclerViewFastScroller.java:202)
at android.view.View.layout(View.java:15596)
at android.view.ViewGroup.layout(ViewGroup.java:4966)
The problem is in VerticalLinearLayoutManagerScrollProgressCalculator:
There is no child at index 0.
This method should handle the case when the RecyclerView has no children, such as when there is not yet any data.
The text was updated successfully, but these errors were encountered: