I am trying to use MediaController to play music. I want the MediaController to appear until the back button is pressed. Now I will try to make the code below:
MediaController mediaController = new MediaController(this){ @Override public void setMediaPlayer(MediaPlayerControl player) { super.setMediaPlayer(player); this.show(); } @Override public void show(int timeout) { super.show(0); }
But this is another problem while the MediaController is displayed. When the MediaController appears, tap the screen, the MediaController will hide. I am also already trying to make the code below:
@Override public boolean onTouchEvent(MotionEvent event) { Log.d("screen","touch"); return true; }
But that did not work. The string did not appear in Logcat. Anyone have an idea to do this?
source share