Here is my solution:
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_MOVE) {
Toast.makeText(getActivity(), "onClick", Toast.LENGTH_LONG).show();
ClipData dragData = ClipData.newPlainText(
AbstractFragment.BUTTON_ID_TAG, "" + v.getId());
DragShadowBuilder shadow = new CanvasDragShadow(v);
v.startDrag(dragData, shadow, null, 0);
return true;
}
return false;
}
I added this Method, and it works. Maybe it's necessary to check the History of MotionEvent
s to have a better user-experience.