@Override public void onPrepared(MediaPlayer mp) { try{ mediaPlayer.setDisplay(surfaceHolder); mediaPlayer.start(); videoControllerView.start(); layoutProgressBar.setVisibility(View.INVISIBLE); RequestsRB.putStartWatchingVideo(this, mCourseId, mToken, mLessons.get(currentVideoNum).getId()); }catch (Exception e){ Log.e("WatchVideoActivity=onPrepared", "ERRROR" + ""); if (mediaPlayer==null) Log.e("WatchVideoActivity=onPrepared", "DA1" + ""); if (mp==null) Log.e("WatchVideoActivity=onPrepared", "DA2" + ""); } } I got the NullPointer in line
if (mediaPlayer==null) Log.e("WatchVideoActivity=onPrepared", "DA1" + "");
Roughly speaking mediaPlayer is null. And mp is not null. Duck because this is the same thing. What kind of garbage)).
Explain to me please
By the way mediaPlayer has public static