2013-04-17 52 views

回答

0

另一种方法是用处理器

Handler h = new Handler(); 
h.postDelayed(new Runnable() { 
    public void run(){ 
    player.start(); 
    } 
}, 10 * 1000); 
3

你可以尝试像下面:诀窍是使用CountDownTimer

player = MediaPlayer.create(getApplicationContext(), R.raw.beepsound); 

CountDownTimer timer = new CountDownTimer(10000, 1000) { 

    @Override 
    public void onTick(long millisUntilFinished) {      
    } 

    @Override 
    public void onFinish() { 
     // TODO Auto-generated method stub 

     player.start(); 
    } 
}; 
timer.start(); 

时用它做不要忘记停止&释放玩家10秒后开始播放。