Code example for AbsoluteLayout.LayoutParams

0
	// TODO Auto-generated method stub 
	Log.i("touch",""+event);
 
	if(status==1) // any event from down and move
	{ 
	LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT,(int)event.getX()-img.getWidth()/2,(int)event.getY()-img.getHeight()/2);
	img.setLayoutParams(lp);
 
	} 
	if(event.getAction()==MotionEvent.ACTION_UP){
	status=0;
 
	img.setBackgroundColor(Color.TRANSPARENT);
 
	} 
	return true; 
	} 
	}); 
	} 
	 
}