¾È³çÇϼ¼¿ä.
¾Èµå·ÎÀÌµå °£´ÜÇÑ ¿¹Á¦¿¡ ´ëÇؼ ¹®ÀǸ¦ µå¸³´Ï´Ù.
¼Ò½º (HandleEvent¿¹Á¦)
--------------------------------------
public class HandleEvent extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View vw = new MyView(this);
setContentView(vw);
}
protected class MyView extends View {
public MyView(Context context) {
super(context);
}
public boolean onTouchEvent(MotionEvent event) {
super.onTouchEvent(event);
if(event.getAction() == MotionEvent.ACTION_DOWN) {
Toast.makeText(HandleEvent.this, "Toutch Event Received", Toast.LENGTH_SHORT).show();
return true;
}
return false;
}
}
}
--------------------------------------
À§¿Í °°ÀÌ ¿¹Á¦ ¼Ò½º°¡ Àִµ¥¿ä.
¾Èµå·ÎÀ̵带 óÀ½ Á¢Çؼ ±×·±µ¥
java¿¡¼ ±¸ÇöÀ» ÇÒ¶§´Â Ŭ·¡½º ¾È¿¡ Ŭ·¡½º¸¦ Àß ¾È½á¼¿ä..
Çåµ¥.
¾Èµå·ÎÀÌµå ¿¹Á¦¸¦ º¸¸é ±×·± ºÎºÐµéÀÌ ¸¹ÀÌ ÀÖ½À´Ï´Ù.
¾Èµå·ÎÀ̵å´Â Åë»ó ´Ù ±×·±°Ç°¡¿ä?
¾Æ´Ï¸é ¿¹Á¦´Ù º¸´Ï ±×·¸°Ô ±¸ÇöÀÌ µÇ¾î Àִ°ÍÀΰ¡¿ä? ±Ã±ÀÇÕ´Ï´Ù.
±×¸®°í Á¦°¡ MyView ¶ó´Â class¸¦ ºÐ¸®¸¦ ÇÒ·Á°í Çϴµ¥..
Àß ¾ÈµÇ¼¿ä ºÐ¸®¸¦ ÇÑ´Ù¸é°í ÇÏ¸é ¾î¶»°Ô °¡´ÉÇÑÁö ´äº¯ Á» ºÎŹµå¸³´Ï´Ù..
* ±ÛÀ» µî·ÏÇϽǶ§ ²À ÇÊ¿äÇÑ °æ¿ì°¡ ¾Æ´Ï¸é °³ÀÎÁ¤º¸¸¦ ³²±âÁö ¸¶¼¼¿ä ^^ (¿¬¶ôó,À̸ÞÀÏÁÖ¼Ò,Áֹεî·Ï¹øÈ£ µî)