I\'m really having a time figuring this one out and can\'t find any friends with the relevant experience so far. It\'s my VERY LAST FEATURE before I release my VERY FIRST APP s
Views that need to be notified of drag events must register OnDragListeners
. If they need to be aware when specific things or types of things move, for instance in order to change their appearance (either to a "DRAG ME HERE!" or a "DON'T YOU DARE DROP THAT ON ME!"). Even if your view is not a valid place to drop the object being dragged, if it needs to be 'drag context aware' so to speak, it registers an OnDragListener
and returns true forACTION_DRAG_STARTED
.
The one thing I'm missing from your very thorough question is what exactly you need to be cleaned up? If you just need to do some generic things that are in the scope of the activity, you might consider adding a different OnDragListener
to the base RelativeLayout
that registers for the events but waits for ACTION_DRAG_ENDED
to alert the activity to perform your generic cleanup code