Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Tombol Kembali
- public boolean onOptionsItemSelected(MenuItem item){
- int id = item.getItemId();
- mp = MediaPlayer.create(Activity_Surat_Al_Falak.this, R.raw.surat_al_falak);
- if (id == R.id.suara) {
- mp.start();
- item.setEnabled(false);
- }else {
- Intent myIntent = new Intent(Activity_Surat_Al_Falak.this, Activity_Surat_Pendek.class);
- startActivity(myIntent);
- finish();
- }
- return super.onOptionsItemSelected(item);
- }
- @Override
- protected void onStop() {
- super.onStop();
- if(mp!=null && mp.isPlaying())
- {
- mp.stop();
- mp.release();
- mp = null;
- }
- }
- @Override
- protected void onDestroy() {
- super.onDestroy();
- if(mp!=null && mp.isPlaying())
- {
- mp.stop();
- mp.release();
- mp = null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement