addPlaylistitem之后androidx mediaplayer致命异常

时间:2019-12-25 02:34:40

标签: androidx

选择声音以在播放声音时添加播放器列表

首先添加声音,将播放器列表设置好 第二次也不错 但是第三或第四次出现致命异常

请提供任何建议。

   E/AndroidRuntime: FATAL EXCEPTION: pool-2-thread-1
    Process: com.example.demo123, PID: 16704
    java.lang.NullPointerException: Attempt to read from field 'java.lang.Object androidx.core.util.Pair.second' on a null object reference
        at androidx.media2.player.MediaPlayer$10.onExecute(MediaPlayer.java:1195)
        at androidx.media2.player.MediaPlayer$PendingFuture.execute(MediaPlayer.java:571)
        at androidx.media2.player.MediaPlayer.executePendingFutures(MediaPlayer.java:3032)
        at androidx.media2.player.MediaPlayer.handleCallComplete(MediaPlayer.java:3024)
        at androidx.media2.player.MediaPlayer$Mp2Callback.onCallCompleted(MediaPlayer.java:3247)
        at androidx.media2.player.exoplayer.ExoPlayerMediaPlayer2Impl$Task$1.notify(ExoPlayerMediaPlayer2Impl.java:941)
        at androidx.media2.player.exoplayer.ExoPlayerMediaPlayer2Impl$2.run(ExoPlayerMediaPlayer2Impl.java:204)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)

0 个答案:

没有答案