I am developing Android 2.1 API 7 app.
In my Activity, I add the onTouchEvent()
callback to handle screen touch event:
public class MyActivity extends Activity{
...
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
//Did something here
Log.v("TOUCH SCREEN", "test");
}
return super.onTouchEvent(event);
}
}
I test this on a real device, but when I touch the screen, it seems the callback is not invoked, because I did not see the Log.v(...)
information. Why??