- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
@Override
public boolean onTouchEvent(MotionEvent e) {
x=(int)e.getX(); y=(int)e.getY();
/* ... */
synchronized(this) {
try {this.wait(1000);}
catch (InterruptedException ex) {}
}
return true;
}
/* Gets (screen/pixel) x,y coordinates of last touch event*/
public boolean GetCoordinates(MutablePoint coordinates) {
if (x==-1) return false;
coordinates.init(x,y);
return true;
}
и да, wait это не sleep, обратите внимание.
Зачем? Зачем вообще MutablePoint? И почему GetCoordinates, а не getCoordinates? Почему бы не
ага, спасибо что дал координаты