简体   繁体   中英

Why isn't multi-touch working for my 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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM