我使用了相同的確切代碼,但與.wav文件,它的工作 - 約50戲劇,然後它墜毀。我切換到MP3文件,他們不會玩。爲什麼播放mp3強制崩潰?
程序本身的工作fine--我知道在這種情況下會出現以下錯誤:
case R.id.playButton:
switch (korean.getIndex()){
case -1: break; // This is the case when the program first starts.
case 0: MediaPlayer.create(this, R.raw.c0).start(); break;
case 1: MediaPlayer.create(this, R.raw.c1).start(); break;
case 2: MediaPlayer.create(this, R.raw.c2).start(); break;
case 3: MediaPlayer.create(this, R.raw.c3).start(); break;
case 4: MediaPlayer.create(this, R.raw.c4).start(); break;
case 5: MediaPlayer.create(this, R.raw.c5).start(); break;
case 6: MediaPlayer.create(this, R.raw.c6).start(); break;
case 7: MediaPlayer.create(this, R.raw.c7).start(); break;
case 8: MediaPlayer.create(this, R.raw.c8).start(); break;
case 9: MediaPlayer.create(this, R.raw.c9).start(); break;
case 10: MediaPlayer.create(this, R.raw.c10).start(); break;
case 11: MediaPlayer.create(this, R.raw.c11).start(); break;
case 12: MediaPlayer.create(this, R.raw.c12).start(); break;
case 13: MediaPlayer.create(this, R.raw.c13).start(); break;
case 14: MediaPlayer.create(this, R.raw.v14).start(); break;
case 15: MediaPlayer.create(this, R.raw.v15).start(); break;
case 16: MediaPlayer.create(this, R.raw.v16).start(); break;
case 17: MediaPlayer.create(this, R.raw.v17).start(); break;
case 18: MediaPlayer.create(this, R.raw.v18).start(); break;
case 19: MediaPlayer.create(this, R.raw.v19).start(); break;
case 20: MediaPlayer.create(this, R.raw.v20).start(); break;
case 21: MediaPlayer.create(this, R.raw.v21).start(); break;
case 22: MediaPlayer.create(this, R.raw.v22).start(); break;
case 23: MediaPlayer.create(this, R.raw.v23).start(); break;
default: break;
}
我知道這是一個lot--但這些都是靜態的方法調用,所以它應該是正常的,對不對?爲什麼會這樣崩潰?
有趣的是,你認爲谷歌會知道... –