在特定的音频瞬间执行动作

时间:2012-06-18 23:10:14

标签: android audio

伙计们正试图在使用getCurrentPosition()播放的音频的特定时刻执行某些操作但当时没有执行。 这是代码:

public class Sound_image_comboActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    MediaPlayer player = MediaPlayer.create(this, R.raw.start);
    player.start();
    while(player.getCurrentPosition()==5671){
        setContentView(R.layout.main2); 
    }
}

}

提前致谢..!

0 个答案:

没有答案