Android: Why can't I give an onClickListener to a VideoView? Android: Why can't I give an onClickListener to a VideoView? android android

Android: Why can't I give an onClickListener to a VideoView?


use VideoView.setOnTouchListener(..) it works for VideoView


Here's how I solved the pause/play of VideoViews using onTouch:

// Class variablesprivate boolean bVideoIsBeingTouched = false;private Handler mHandler = new Handler();vvVideo.setOnTouchListener(new View.OnTouchListener() {    @Override    public boolean onTouch(View v, MotionEvent event) {    if (!bVideoIsBeingTouched) {        bVideoIsBeingTouched = true;    if (vvVideo.isPlaying()) {        vvVideo.pause();    } else {        vvVideo.resume();    }    mHandler.postDelayed(new Runnable() {        public void run() {            bVideoIsBeingTouched = false;        }        }, 100);    }    return true;    }});


I know this is old but I used this:

    mVideoView.setOnTouchListener(new View.OnTouchListener()    {        @Override        public boolean onTouch(View v, MotionEvent event) {            Log.i(TAG, "Video 1 clicked, starting playback");            return false;        }    });