title: Android trigger onTouch after onLongPress
body: <p>I am currently trying to implement Drag and Drop in Android. The draging should be done on an item from a ListView. The thing is that the elements(items) in this ListView should have some sort of action when they are touched (single taped) and they should be dragable after the user perform a long press on one of the items. I got the code for draging from a tutorial but the problem that i cannot solve is:
  After the user holds his finger on an item from the ListView the onTouch(MotionEvent ev) is called at the beginning and after a second GestureDetector.onLongPress is called.
  My draging logic is implemented in the onTouch methods. What i currently do is set a boolean (isLongPressed) to true after LongPress is enabled and in the onTouch methods i check if this boolean is true - if yes then perform the draging.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>    public class DragNDropListView extends ListView implements  GestureDetector.OnGestureListener,
      GestureDetector.OnDoubleTapListener
      {
  
      private boolean isLongPressed
  
      @Override
  public boolean onTouchEvent(MotionEvent ev)
  {
      mGestureDetector.onTouchEvent(ev);
  
      if (!isLongPressed)
      {
          Log.e("Not Long", "Its Not Longpressed yet");
          return super.onTouchEvent(ev);
      }
  
      final int action = ev.getAction();
      final int x = (int) ev.getX();
      final int y = (int) ev.getY();
  
      if (action == MotionEvent.ACTION_DOWN &amp;&amp; isLongPressed)
      {
          mDragMode = true;
      }
  
      if (!mDragMode)
          return super.onTouchEvent(ev);
  
      switch (action)
      {
      case MotionEvent.ACTION_DOWN:
      Log.e("Action down", "Down");
      break;
  
      case MotionEvent.ACTION_MOVE:
              Log.e("ACTION MOVE", "Move");
              drag()
              break;
          case MotionEvent.ACTION_UP:
          {
              isLongPressed = false;
          }
      }
  
      @Override
  public void onLongPress(MotionEvent ev)
  {
      Log.e("LongPress", "LongPressed");
      isLongPressed = true;
      mGestureDetector.setIsLongpressEnabled(isLongPressed);
      super.onTouchEvent(ev);
      }
  </code></pre>
  
  <p>What happens is that i get "isNotLongPressed" if i just tab the items (desired behavior), After a long press i get "LongPressed" but then if i start draging i get nothing. If i release my finger and then start the drag everything is ok but i want to be able to drag immediately after the long press is registered.</p>