Code example for View.DragShadowBuilder

0
 
	public boolean onTouch(View v, MotionEvent touchEvent) {
		Square square = (Square)v;
		if(square.getNumber() != 0) {
			ClipData dragData = ClipData.newPlainText("tilenumber", ""+square.getNumber());
		    DragShadowBuilder myShadow = new View.DragShadowBuilder(v);
		    v.startDrag(dragData, myShadow, v, 0);
		    square.setNumber(0);
		    return true; 
		} 
		else { 
			return false; 
		} 
	} 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE