开发者

how to stop media player in android

开发者 https://www.devze.com 2023-01-14 09:05 出处:网络
when open my apps gallery is running and set current gallery image to imageview and playing one audio file through media player if i come out of my aps even it is running

when open my apps gallery is running and set current gallery image to imageview and playing one audio file through media player if i come out of my aps even it is running

i tried to give mp.stop() and mp.release() in destroy method bu开发者_StackOverflow中文版t it wont work for me please suggest me

Thanks in Advance

aSwan


i have updated my answer! to avoid the "-1´s" =P

   if (mp != null) {
        mp.stop();  // Stop play
        mp.release(); 
        mp = null; // set Media Player to null
   }
0

精彩评论

暂无评论...
验证码 换一张
取 消