this.setOnTouchListener(new OnTouchListener(){
public boolean onTouch(View v, MotionEvent event) {
switch(event.getAction()){
case MotionEvent.ACTION_DOWN:
System.out.println("touch down");
lastTouchX = event.getX();
break;
case MotionEvent.ACTION_UP:
System.out.println("touch up");
float upX = event.getX();
float val = Math.abs(upX - lastTouchX);
System.out.println( String.valueOf(val) );
if(val > 100){
setBackgroundImageClean();
}
break;
case MotionEvent.ACTION_CANCEL:
System.out.println("touch cancel");
break;
}
return true;
}
});