You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. Some of my users are experiencing the following exception:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
at net.idik.lib.slimadapter.SlimAdapter.getItemViewType(SlimAdapter.java:242)
at net.idik.lib.slimadapter.SlimAdapterEx.getItemViewType(SlimAdapterEx.java:99)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5507)
at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:282)
at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:336)
at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:349)
at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:356)
at android.support.v7.widget.GapWorker.run(GapWorker.java:387)
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:6688)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
It seems to be related to this line in particular. data.get(position); is returning null, hence dataTypes.indexOf(item.getClass()); fails with an NPE (item is null by that time).
Any idea what might be causing this?
The text was updated successfully, but these errors were encountered:
i am sorry for recheck the issues so late,i am getting busy these days,, T T
it seems like the “data“ in the adapter has changed outside the adapter,as you see in the source, the "data" is just a refrence to the raw data set, so u should let the adapter knew when the raw data set changed with the "notifydatasetchanged()" method. Hope this helps.
Hi. Some of my users are experiencing the following exception:
It seems to be related to this line in particular.
data.get(position);
is returningnull
, hencedataTypes.indexOf(item.getClass());
fails with an NPE (item
is null by that time).Any idea what might be causing this?
The text was updated successfully, but these errors were encountered: