私のタスクが実行され、最後のいくつかのサウンドまでうまく動作します。それは力の閉鎖を保持するいくつかの奇妙な理由で、私は見て見て、理由を取得しないでください。私は離れて音を出し、いくつかの他のステップを行ったと私はサイズの制限や何かを理解していない?Androidのサウンドボードのエラー
2番目のプログラムですが、これは何のアイデアですか?
MediaPlayer mp1, mp2, mp3, mp4, mp5, mp6, mp7, mp8, mp9, mp10, mp11, mp12,
mp13, mp14, mp15, mp16, mp17, mp18, mp19, mp20, mp21, mp22, mp23, mp24, mp25,
mp26, mp27, mp28;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//set up the button sound
mp1 = MediaPlayer.create(this, R.raw.backtoyou);
//button 1 coding
ImageButton Button1 = (ImageButton) findViewById (R.id.button01);
Button1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
mp1.start();
}
});
//longclick creates ringtone notification
//Button1.setLongClickable(true);
//set up the button sound
mp2 = MediaPlayer.create(this, R.raw.blow);
//button 1 coding
ImageButton Button2 = (ImageButton) findViewById (R.id.button02);
Button2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
mp2.start();
}
});
//set up the button sound
mp3 = MediaPlayer.create(this, R.raw.boomstick);
//button 1 coding
ImageButton Button3 = (ImageButton) findViewById (R.id.button03);
Button3.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
mp3.start();
}
});
//set up the button sound
mp4 = MediaPlayer.create(this, R.raw.byebye);
//button 1 coding
ImageButton Button4 = (ImageButton) findViewById (R.id.button04);
Button4.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
mp4.start();
}
});
....などがあります。だから、ファイルのエラーはどこにあり、なぜ強制終了されますか?
あなたはアプリのクラッシュ製造されているlogcatメッセージを投稿することができますか? – slayton
ヌルポインタの例外はそれがリストしている唯一のものですが、私はそれがクラッシュするメディアプレーヤーのあまりにも多くのインスタンスに沸騰していると確信しています。 –