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
How can you reproduce? When there is nothing to fetch, if you perform a click on the listview header, NPE occurs. I've solved it by adding "if(mOnItemClickListener != null && mState!=State.REFRESHING)". So the item click listener will not be consumed.
The mOnItemClickListener (see point [1] below) is not null but it throws NPE because the arguments of the listener are null, because the event is not performed on any of the child items.
In class:
private class PTROnItemClickListener implements OnItemClickListener{
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
mHasResetHeader = false;
if(mOnItemClickListener != null && mState!=State.REFRESHING){
mOnItemClickListener.onItemClick(adapterView, view, position, id); /// [1]
}
}
}
Looking forward your feedback. Cheers!
The text was updated successfully, but these errors were encountered:
Even when I remove all the items from the adapter, none of these items are null and no crash occurs when clicking the header. Can you provide me with a more complete sample? Are you on the master branch or development branch? What commit?
How can you reproduce? When there is nothing to fetch, if you perform a click on the listview header, NPE occurs. I've solved it by adding "if(mOnItemClickListener != null && mState!=State.REFRESHING)". So the item click listener will not be consumed.
The mOnItemClickListener (see point [1] below) is not null but it throws NPE because the arguments of the listener are null, because the event is not performed on any of the child items.
In class:
private class PTROnItemClickListener implements OnItemClickListener{
Looking forward your feedback. Cheers!
The text was updated successfully, but these errors were encountered: