Select to view content in your preferred language

Drag and Drop onDragPointerMove Stops Map Scrolling

821
1
Jump to solution
01-21-2013 10:03 AM
GSauers
Frequent Contributor
Hello, I am trying to drag an image/graphic from its location to another location. I have added the onDragPointerMove method to my touch listener, but when I run the app I can no longer scroll around the map, it is constantly detecting a drag pointer. So when trying to scroll/move the map to a new location, it does not move correctly. I have tried returning false expecting it to skip the method, but it reacts the same way. Any help or suggestions are greatly appreciated. Below is the code I am using:

  public boolean onDragPointerMove(MotionEvent from, MotionEvent to) {

   //Checks to see if the drag is occuring on a graphic
   int[] ids = graphicsLayer.getGraphicIDs(from.getX(), from.getY(), 25);
   if (ids != null && ids.length > 0) {
    return true;
   }
   return false;
  }//end of onDragPointerMove

Thanks.
0 Kudos
1 Solution

Accepted Solutions
GSauers
Frequent Contributor
Solved the issue I was having. You need to return the parent activity before the end of onDragPointerMove. Hope this helps others in the future.

return super.onDragPointerMove(from, to);

View solution in original post

0 Kudos
1 Reply
GSauers
Frequent Contributor
Solved the issue I was having. You need to return the parent activity before the end of onDragPointerMove. Hope this helps others in the future.

return super.onDragPointerMove(from, to);
0 Kudos