I know how to take control of the back button. I have a VideoView embedded in a FrameLayout. My question is when the video pops up, the video contr
VideoView
FrameLayout
You can simply write:
mVideoView.setMediaController(new MediaController(this){ public boolean dispatchKeyEvent(KeyEvent event) { if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) ((Activity) getContext()).finish(); return super.dispatchKeyEvent(event); } });
No need to create new class.