Code example for SoundPool

Methods: releaseunload

0
	} 
	@Override 
	public void onStop() { 
		super.onStop(); 
		if(mSoundPool == null){
			mSoundPool.unload(buttonClick_sound);
			mSoundPool.release();
		} 
	} 
	@Override 
	public void onDestroy() { 
		super.onDestroy(); 
	} 
	class StageSelectClickListener implements OnClickListener {		
		public void onClick(View v) {
			mSoundPool.play(buttonClick_sound, 0.5f, 0.5f, 1, 0, 1.0f);
			if(v == iv[0]) {Intent it = new Intent(StageSelectActivity.this, FirstStage.class);it.putExtra("Life", 3);it.putExtra("score", 0);startActivity(it);StageSelectActivity.this.finish();}
			else if(v == iv[1]) {Intent it = new Intent(StageSelectActivity.this, SecondStage.class);it.putExtra("Life", 3);it.putExtra("score", 0);startActivity(it);StageSelectActivity.this.finish();}
			else if(v == iv[2]) {Intent it = new Intent(StageSelectActivity.this, ThirdStage.class);it.putExtra("Life", 3);it.putExtra("score", 0);startActivity(it);StageSelectActivity.this.finish();}
			else if(v == iv[3]) {Intent it = new Intent(StageSelectActivity.this, FourthStage.class);it.putExtra("Life", 3);it.putExtra("score", 0);startActivity(it);StageSelectActivity.this.finish();}
			else if(v == iv[4]) {Intent it = new Intent(StageSelectActivity.this, FifthStage.class);it.putExtra("Life", 3);it.putExtra("score", 0);startActivity(it);StageSelectActivity.this.finish();}