NPE, Each time I try to delete the first visible item in ListView
I need help figuring out why I get Null pointer exception each time I try
to delete the first item in my listView (which is visible). Deleting every
other item works fine without any error but the first item keeps failing.
here is the code:
private void deleteCurrentItem() {
ContextualUndoView contextualUndoView = (ContextualUndoView)
mDismissView;
int position = getAbsListView().getPositionForView(
mDeleteItemCallback.deleteItem(position);
}
Detailed code: http://paste.org/66633
error log:
08-10 19:09:22.107: E/AndroidRuntime(973): FATAL EXCEPTION: main
08-10 19:09:22.107: E/AndroidRuntime(973): java.lang.NullPointerException
08-10 19:09:22.107: E/AndroidRuntime(973): at
android.widget.AdapterView.getPositionForView(AdapterView.java:597)
08-10 19:09:22.107: E/AndroidRuntime(973): at
com.haarman.listviewanimations.itemmanipulation.contextualundo.ContextualUndoAdapter$RemoveViewAnimatorListenerAdapter.deleteCurrentItem(ContextualUndoAdapter.java:205)
08-10 19:09:22.107: E/AndroidRuntime(973): at
com.haarman.listviewanimations.itemmanipulation.contextualundo.ContextualUndoAdapter$RemoveViewAnimatorListenerAdapter.onAnimationEnd(ContextualUndoAdapter.java:193)
08-10 19:09:22.107: E/AndroidRuntime(973): at
com.nineoldandroids.animation.ValueAnimator.endAnimation(ValueAnimator.java:1034)
08-10 19:09:22.107: E/AndroidRuntime(973): at
com.nineoldandroids.animation.ValueAnimator.cancel(ValueAnimator.java:968)
08-10 19:09:22.107: E/AndroidRuntime(973): at
com.haarman.listviewanimations.itemmanipulation.contextualundo.ContextualUndoAdapter$RecycleViewListener.onMovedToScrapHeap(ContextualUndoAdapter.java:276)
08-10 19:09:22.107: E/AndroidRuntime(973): at
android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:6449)
08-10 19:09:22.107: E/AndroidRuntime(973): at
android.widget.ListView.measureHeightOfChildren(ListView.java:1256)
No comments:
Post a Comment