Android: mediaplayer went away with unhandled events

后端 未结 2 1826
一向
一向 2021-01-31 13:37

I need to get the duration of an audio file for a series of voice announcements that need to play from an app. I have added the audio files as resources and they do play just f

2条回答
  •  一向
    一向 (楼主)
    2021-01-31 14:02

    The holy five:

        if(mp!=null) {
            if(mp.isPlaying())
                mp.stop();
            mp.reset();
            mp.release();
            mp=null;
        }
    

提交回复
热议问题