private View.OnKeyListener handleTouch = new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
int x = (int) v.getX();
int y = (int) v.getY();
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
Log.i("TAG", "touched down");
// Toast.makeText(MainActivity.this, "touched down", Toast.LENGTH_SHORT).show(); cordinate.setText("touched down");
break;
case MotionEvent.ACTION_MOVE:
Log.i("TAG", "moving: (" + x + ", " + y + ")");
// Toast.makeText(MainActivity.this, "moving: (X" + x + ", Y" + y + ")", Toast.LENGTH_SHORT).show(); cordinate.setText("X" + x + ", Y" + y + "");
break;
case MotionEvent.ACTION_UP:
Log.i("TAG", "touched up");
// Toast.makeText(MainActivity.this, "touched up", Toast.LENGTH_SHORT).show(); cordinate.setText("touched up");
break;
}
return true;
}
};