开发者

MediaPlayer playing files on AVD, on PDA throwing errors

This is my method in service for playing files, on AVD everything works fine, no errors, when I click the control开发者_如何转开发 on PDA I get these LogCat events: http://pastebay.com/125483. I have no clue what is happening. Please advise.

public void playAudio (int playAudio) { 

    player = MediaPlayer.create(this, playAudio);

    try {           
        if (player != null) { 
            player.stop();          
            }
        player.prepare();
        player.start();

    } catch (IllegalStateException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();

        } finally {

    }

}


I solved it, the problem was I called prepare(); after MediaPlayer.create since it prepares the MediaPlayer already.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜