Do I have a MediaPlayer member variable hosted in my parent class and after it starts it never calls onCompletion, or at least onCompletionListener will never catch it? My code looks something like this.
mediaPlayer = Mediaplayer.create(this, currentSample); mediaPlayer.start();
Elsewhere in the code is my onCompletionListener
mediaPlayer.setOnCompletionListener(new OnCompletionListener() { public void onCompletion(MediaPlayer mp) { if (repeatFlag == true) { handler.removeCallbacks(sampleRunnable); handler.postDelayed(sampleRunnable, delay); } } });
I use a handler to call sampleRunnable because I want to encode it with a given delay interval. However, onCompletion never seems to be called. I am pretty sure of this because I set breakpoints in onCompletion that never pause the program, and I tried step by step, and this is never called. Any ideas?
source share