MediaPlayer mediaPlayer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//To play background sound
if (getInt("Sound", 0) == 0) {
mediaPlayer = MediaPlayer.create(this, R.raw.abc);
mediaPlayer.start();
mediaPlayer.setLooping(true);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//To play background sound
if (getInt("Sound", 0) == 0) {
mediaPlayer = MediaPlayer.create(this, R.raw.abc);
mediaPlayer.start();
mediaPlayer.setLooping(true);
}
}
0 comments:
Post a Comment