티스토리 뷰
import android.content.Context;
import android.view.MotionEvent;
public class test extends Activity {
@Override
public boolean onTouchEvent(MotionEvent event) {
int action = event.getAction();
int xPos = -1;
int yPos = -1;
switch (action) {
case (MotionEvent.ACTION_DOWN): // Touch screen pressed
break;
case (MotionEvent.ACTION_UP): // Touch screen touch ended
break;
case (MotionEvent.ACTION_MOVE): // Contact has moved across screen
// Single touch event.
xPos = (int) event.getX();
yPos = (int) event.getY();
break;
case (MotionEvent.ACTION_CANCEL): // Touch event cancelled
break;
case (MotionEvent.ACTION_OUTSIDE): // Movement has occurred outside the
// bounds of the screen element
// being monitored
break;
}
return super.onTouchEvent(event);
}
}
'Studying > Android' 카테고리의 다른 글
PC에 설치된 안드로이드 조작 방법 (0) | 2011.03.30 |
---|---|
BlueRemoteControl - 미완성 (UI 작업 전) (0) | 2011.03.28 |
기울기 센서 값 가지고 오기 (0) | 2011.03.23 |
블루투스 연결 서버 소스 (0) | 2011.03.23 |
블루투스 연결 클라이언트 소스 (0) | 2011.03.23 |