NullPointerEx in example app
See original GitHub issueHi @lisawray
I tried today for the first time the example app and it keeps crashing on the newly added onClickListener code with this stacktrace:
java.lang.NullPointerException: Attempt to invoke interface method ‘void com.genius.groupie.OnItemClickListener.onItemClick(com.genius.groupie.Item, android.view.View)’ on a null object reference at com.genius.groupie.ViewHolder$1.onClick(ViewHolder.java:22)at android.view.View.performClick(View.java:5637)at android.view.View$PerformClick.run(View.java:22429)at android.os.Handler.handleCallback(Handler.java:751)at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Debugging show me that in this piece of code:
if (getAdapterPosition() != NO_POSITION) { onItemClickListener.onItemClick(getItem(), v); }
onItemClickListener it’s always null. At first, I thoughts it was an error in the ViewHolder bind method but I’m not quite sure now.
Before writing this, I tried to find a duplicate issue in the list and it seems not present.Anyway, I could be wrong so…sorry, just in case 😃
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
@lisawray I can confirm actually this solved the problem. It’s now working perfectly. @lkishor are u gonna submit a PR for this?
Thank you for your patience. I’ve just worked through transferring the library on github with the guys at Genius and will be publishing a new release ASAP under a different package name!