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
I have a custom ViewGroup that called onLayout directly, but this line scrollListener.updateHandlePosition(recyclerView); will make application force closed with error java.lang.NullPointerException: Attempt to invoke virtual method 'int android.support.v7.widget.RecyclerView.computeVerticalScrollOffset()' on a null object reference
Actually i could avoid the force closed easily by setting mFastScroller.setRecyclerView(mRecyclerView); twice: after findViewById and after mRecyclerView.setAdapter(mAdapter);
But i think it will be more useful if the library itself check for null object directly before set any value to it.
The text was updated successfully, but these errors were encountered:
hendrawd
changed the title
Force close if my custom view group called onLayout directly
Force close if my custom ViewGroup called onLayout directly
Jun 22, 2017
hendrawd
changed the title
Force close if my custom ViewGroup called onLayout directly
Force closed if my custom ViewGroup called onLayout directly
Jun 22, 2017
I have a custom ViewGroup that called onLayout directly, but this line scrollListener.updateHandlePosition(recyclerView); will make application force closed with error
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.support.v7.widget.RecyclerView.computeVerticalScrollOffset()' on a null object reference
Actually i could avoid the force closed easily by setting
mFastScroller.setRecyclerView(mRecyclerView);
twice: after findViewById and aftermRecyclerView.setAdapter(mAdapter);
But i think it will be more useful if the library itself check for null object directly before set any value to it.
The text was updated successfully, but these errors were encountered: