开发者

Android development: OnTouchEvent

开发者 https://www.devze.com 2023-03-20 04:50 出处:网络
I\'m using: @Override public boolean onTouchEvent(MotionEvent event) { I\'m using surfaceview. But when I try:

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

精彩评论

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