MediaPlayer 释放的问题
我一退出Acitivity 就报这个错
error (-38, 0)
pause called instate 0
Error (-38 , 0)
stop called in state 0
我重写了onDestroy@Override
protected void onDestroy() {
if(mplayer!=null){
mplayer.stop();
mplayer.release();
}
super.onDestroy();
if(timer != null)//释放计时器
timer.cancel();
finish();
}请问这是什么问题啊
我一退出Acitivity 就报这个错
error (-38, 0)
pause called instate 0
Error (-38 , 0)
stop called in state 0
我重写了onDestroy@Override
protected void onDestroy() {
if(mplayer!=null){
mplayer.stop();
mplayer.release();
}
super.onDestroy();
if(timer != null)//释放计时器
timer.cancel();
finish();
}请问这是什么问题啊
什么意思啊 ??
我先停止音乐 在释放MediaPlayer
只有Stated ->Paused状态才可以执行pause();
Prepared/Started/Paused/Completed状态才可以执行stop()到Stopped状态。
另外,pause()也可以作用在处于Paused状态,状态不变;stop()也可以作用在处于Stopped状态,状态不变.给你个私家珍藏
http://blog.csdn.net/thl789/article/details/7375008