eowise / recyclerview-stickyheaders

DEPRECATED. Android library that integrate sticky section headers in your RecyclerView
http://eowise.github.io/recyclerview-stickyheaders
MIT License
961 stars 148 forks source link

Another Force Close #24

Closed rubengees closed 9 years ago

rubengees commented 9 years ago

Hi, I just discovered a new Force Close:

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:2485)
            at com.eowise.recyclerview.stickyheaders.StickyHeadersTouchListener$SingleTapDetector.findItemHolderUnder(StickyHeadersTouchListener.java:78)
            at com.eowise.recyclerview.stickyheaders.StickyHeadersTouchListener$SingleTapDetector.onSingleTapConfirmed(StickyHeadersTouchListener.java:53)
            at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:273)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)

In my case I add one element with one header and then 2 other elements with another header. When I delete all items starting from the bottom, the app closes when I delete the last. (that at top) It looks like it has to do with the on header click listener which I use.

rubengees commented 9 years ago

This also happens when i have an empty RecyclerView and click on it.

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:2485)
            at com.eowise.recyclerview.stickyheaders.StickyHeadersTouchListener$SingleTapDetector.findItemHolderUnder(StickyHeadersTouchListener.java:78)
            at com.eowise.recyclerview.stickyheaders.StickyHeadersTouchListener$SingleTapDetector.onSingleTapUp(StickyHeadersTouchListener.java:47)
            at android.view.GestureDetector.onTouchEvent(GestureDetector.java:595)
            at com.eowise.recyclerview.stickyheaders.StickyHeadersTouchListener.onInterceptTouchEvent(StickyHeadersTouchListener.java:25)
            at android.support.v7.widget.RecyclerView.dispatchOnItemTouch(RecyclerView.java:1466)
            at android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:1557)
            at android.view.View.dispatchTouchEvent(View.java:8388)
rubengees commented 9 years ago

Are you still working on this? The problem with the empty recyclerview is pretty bad.

leruaa commented 9 years ago

This should be fixed with the commit above (I've updated the snapshot).

Sorry for the delay, I was quite busy lately.

rubengees commented 9 years ago

Okay, no problem thank you for your work. Which snapshot is it? This one? 'com.eowise:recyclerview-stickyheaders:0.5.1-SNAPSHOT@aar'

leruaa commented 9 years ago

Yes.

rubengees commented 9 years ago

i've tested both the snapshot and the new version you uploaded today, but the bug seems to be not gone :/

leruaa commented 9 years ago

Can you post the new stacktrace ?

rubengees commented 9 years ago

I'm sorry, I forgot to answer. I think it was the same stacktrace, but I switched now to a different layout in my app, so I don't use this library anymore.