jjzjj

isPlaying

全部标签

MediaPlayer.isplaying() 方法中的 java.lang.IllegalStateException

publicstaticMediaPlayermp=null;publicstaticvoidplayGeneric(intname,finalImageButtonbutton,finalImageButtonpervious,Contextcontext){button.setEnabled(false);button.setClickable(false);pervious.setEnabled(false);pervious.setClickable(false);try{if(mp!=null&&mp.isPlaying()){mp.stop();mp.release();m

java - MediaPlayer isPlaying() 总是返回 false

我正在2部手机上进行测试。在一台设备中,媒体播放器的isPlaying()即使在播放时也始终返回false。但在其他设备(lgoptimusGingerbread)中,isPlaying()返回true是否正在播放,否则返回false。谁能告诉我为什么会这样?我的一些代码依赖于这个isPlaying()部分,我想让它在所有设备上工作。publicvoidaddSoundMedia(Contextcontext,intresId){MediaPlayermp=MediaPlayer.create(context,resId);mp.setVolume(1.0f,1.0f);try{mPl
12