开发者

Android development: OnTouchEvent

I'm using:

@Override
    public boolean onTouchEvent(MotionEvent event) {

I'm using surfaceview.

But when I try:

if (event.getAction() == MotionEvent.ACTION_UP) {
    Log.d("STATE: ", "Up");

It is never called. What is the reason?

It is really annoying, because I开发者_开发知识库 want my player to move when I hold down the screen.


Ensure you are returning true return true; after you complete processing of the event (ACTION_UP in this case) and also returning super.onTouchEvent(event) for every other event (i.e. the default)?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜