Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Crash app when drag and drop item in listview #372

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Crash app when drag and drop item in listview #372

wants to merge 25 commits into from

Conversation

khiemvu
Copy link

@khiemvu khiemvu commented Dec 16, 2015

Hi all,

I use listviewanimations in my app, and sometime app force close when i drag and drop item in listview

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setVisibility(int)' on a null object reference
at com.nhaarman.listviewanimations.itemmanipulation.dragdrop.DragAndDropHandler$LSwitchViewAnimator$AnimateSwitchViewOnPreDrawListener.onPreDraw(DragAndDropHandler.java:588)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:921)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2214)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1230)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6748)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
at android.view.Choreographer.doCallbacks(Choreographer.java:590)
at android.view.Choreographer.doFrame(Choreographer.java:560)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6117)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

I don't understand why althought at line 588 in DragAndDropHandler.java really check not null before

nhaarman and others added 25 commits August 21, 2014 22:15
Currently, drag and drop handler chooses a list item
which is located at some moved point.
But it has little difference from the point at touch down.

This pull request fixes DragAndDropHandler to drag a list item
which is located at touch down.
…wrap StickyListHeaders item before trying to find ListViewAnimations' tags from it
…oter view using SimpleSwipeUndoAdapter. Fixes #277.
Also updated the Exception messages to contain the new
setListViewWrapper method.
These should be generated by eclipse at maven project import.
… to work on API 8 or higher.

Fix running example app on Emulator without Google Play Store.

Fix most problems with drag&drop on API levels < 14.
Also contains fix for #254

refresh mMobileView only when needed.

Fix visible mobileView when dragging on API < 14.

This works only when SimpleSwipeUndo is enabled too. When it's not enabled the mobileView remains is visible.

Some cleanup, fixed scroll item swapping.
…stItemAdapter

Added setAbsListView to ExpandableListItemAdapter
Enabled refreshMobileView for all API's.
Shorter test delays.
@Sonalboraste
Copy link

I am also facing the same problem while doing drag and drop operation in list view. Problem in DragAndDropHandler.java at line #588

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants