I am using animation in my app, Whenever activity starts i set the contentview to that animation class but whenever user go back it crashes its happening only where i have used the animation..Can you tell me how can i save my app from this crash
import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
public class Ultimate_bomb extends Activity {
FireworkLayout my;
MediaPlayer sound;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
my = new Animation(this);
setContentView(my);
sound = MediaPlayer.create(Ultimate_bomb.this, R.raw.ultimate_bomb);
sound.start();
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
sound.release();
finish();
}
}