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
SuperSLiM's been a great library so far. Unfortunately, a bug came up which I can't seem to figure out. The library and layoutmanager work fine when first set of items. However, the layout manager crashes when "notifyItemChanged" is called from the adapter. The dataset I'm using happened to have alternating header/content entries. The current work around I'm using entails creating a new adapter with the new data and replacing the old one attached to the RecyclerView like so:
list.setAdapter(null); listAdapter = new ListAdapter(newData); list.setAdapter(listAdapter);
The support library I'm using is version 25.3.1. Here's the full stack trace:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams android.view.View.getLayoutParams()' on a null object reference at android.support.v7.widget.RecyclerView$LayoutManager.getPosition(RecyclerView.java:7949) at com.tonicartos.superslim.LayoutManager.onItemsUpdated(LayoutManager.java:530) at android.support.v7.widget.RecyclerView$LayoutManager.onItemsUpdated(RecyclerView.java:9366) at android.support.v7.widget.RecyclerView$6.dispatchUpdate(RecyclerView.java:863) at android.support.v7.widget.RecyclerView$6.onDispatchSecondPass(RecyclerView.java:874) at android.support.v7.widget.AdapterHelper.consumeUpdatesInOnePass(AdapterHelper.java:570) at android.support.v7.widget.RecyclerView.processAdapterUpdatesAndSetAnimationFlags(RecyclerView.java:3256) at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3050) at android.view.View.measure(View.java:18794) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18794) at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1658) at android.view.View.measure(View.java:18794) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) at android.view.View.measure(View.java:18794) at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:1081) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465) at android.widget.LinearLayout.measureVertical(LinearLayout.java:748) at android.widget.LinearLayout.onMeasure(LinearLayout.java:630) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465) at android.widget.LinearLayout.measureVertical(LinearLayout.java:748) at android.widget.LinearLayout.onMeasure(LinearLayout.java:630) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465) at android.widget.LinearLayout.measureVertical(LinearLayout.java:748) at android.widget.LinearLayout.onMeasure(LinearLayout.java:630) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643) at android.view.View.measure(View.java:18794) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216)
The text was updated successfully, but these errors were encountered:
Hi,
SuperSLiM's been a great library so far. Unfortunately, a bug came up which I can't seem to figure out. The library and layoutmanager work fine when first set of items. However, the layout manager crashes when "notifyItemChanged" is called from the adapter. The dataset I'm using happened to have alternating header/content entries. The current work around I'm using entails creating a new adapter with the new data and replacing the old one attached to the RecyclerView like so:
list.setAdapter(null); listAdapter = new ListAdapter(newData); list.setAdapter(listAdapter);
The support library I'm using is version 25.3.1. Here's the full stack trace:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams android.view.View.getLayoutParams()' on a null object reference at android.support.v7.widget.RecyclerView$LayoutManager.getPosition(RecyclerView.java:7949) at com.tonicartos.superslim.LayoutManager.onItemsUpdated(LayoutManager.java:530) at android.support.v7.widget.RecyclerView$LayoutManager.onItemsUpdated(RecyclerView.java:9366) at android.support.v7.widget.RecyclerView$6.dispatchUpdate(RecyclerView.java:863) at android.support.v7.widget.RecyclerView$6.onDispatchSecondPass(RecyclerView.java:874) at android.support.v7.widget.AdapterHelper.consumeUpdatesInOnePass(AdapterHelper.java:570) at android.support.v7.widget.RecyclerView.processAdapterUpdatesAndSetAnimationFlags(RecyclerView.java:3256) at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3050) at android.view.View.measure(View.java:18794) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18794) at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1658) at android.view.View.measure(View.java:18794) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461) at android.view.View.measure(View.java:18794) at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:1081) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465) at android.widget.LinearLayout.measureVertical(LinearLayout.java:748) at android.widget.LinearLayout.onMeasure(LinearLayout.java:630) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465) at android.widget.LinearLayout.measureVertical(LinearLayout.java:748) at android.widget.LinearLayout.onMeasure(LinearLayout.java:630) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1465) at android.widget.LinearLayout.measureVertical(LinearLayout.java:748) at android.widget.LinearLayout.onMeasure(LinearLayout.java:630) at android.view.View.measure(View.java:18794) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951) at android.widget.FrameLayout.onMeasure(FrameLayout.java:194) at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2643) at android.view.View.measure(View.java:18794) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2100) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1216)
The text was updated successfully, but these errors were encountered: