0

I read on the net that mediaplayer.pause () or stop () does not work for projects with sdk minimum less than 24. In this case, how could i proceed? my minimum sdk is 16 and I would like to keep it at 16 while implementing pause and stop in my app , if no i did so mediaplayer.pause() .i got this error

QCMediaPlayer mediaplayer NOT present

what matters most to me is how to implement pause and play. my pause method ;

 pause.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    if (mediaPlayer.isPlaying()) {
                        mediaPlayer.pause();
                    }
                }
            });
Rolanddev
  • 49
  • 7
  • Can you link the source where you read this? Because in android documentation both stop and pause should work even before api 24. – Vince VD Mar 25 '20 at 20:47
  • And please add some code because it's difficult too solve a problem without any code. – Vince VD Mar 25 '20 at 20:48
  • 1
    https://stackoverflow.com/questions/24501086/why-mediaplayer-throws-not-present-error-when-creating-instance-of-it – Vince VD Mar 25 '20 at 20:51

0 Answers0