我曾写过这部法律,我完全理解,为什么给我在“}”上留下的意想不到的错,将其删除到
?
private class DemoView extends View{
public DemoView(Context context) {
super(context);
// TODO Auto-generated constructor stub
}//here***
final int x = 0;
final int y = 0;
this.setOnTouchListener(new View.OnTouchListener(){
public boolean onTouch(View v, MotionEvent e){
switch(e.getAction()){
case MotionEvent.ACTION_DOWN:
x++;
break;
case MotionEvent.ACTION_MOVE: // touch drag with the ball
// move the balls the same as the finger
x = x-25;
y = y-25;
break;
}
return true;
}//here***
}
增 编