开发者

Why isn't multi-touch working for my imagebuttons?

开发者 https://www.devze.com 2022-12-28 16:29 出处:网络
I\'m using imagebuttons that play sounds using SoundPool. Here is example code of one of the imagebuttons:

I'm using imagebuttons that play sounds using SoundPool. Here is example code of one of the imagebuttons:

ImageButton Button1 = (ImageButton)findViewById(R.id.sound); Button1.setOnTouchListener(new OnTouchListener() {

        public boolean onTouch(View v, MotionEvent event) {开发者_运维技巧
            if (event.getAction() == MotionEvent.ACTION_DOWN ) {
                mSoundManager.playSound(1);
                return false;
            }

            return false;
        }
    });

For some reason, it doesn't allow you to click multiple buttons at the same time. Is it because I'm building for 1.6 SDK?

Thanks!


why aren't you using onClickListener??????

    ImageButton t = new ImageButton(this);
    t.setOnClickListener(clickListener);
0

精彩评论

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

关注公众号