Advertisement
Guest User

Untitled

a guest
Oct 19th, 2013
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. package com.iklikla.eightgame;
  2.  
  3. import android.media.MediaPlayer;
  4. import android.os.Bundle;
  5. import android.app.Activity;
  6. import android.view.View;
  7. import android.widget.Button;
  8.  
  9. public class MainActivity extends Activity {
  10.  
  11. Button eight = (Button)findViewById(R.id.eightbutton);
  12.  
  13. @Override
  14. protected void onCreate(Bundle savedInstanceState) {
  15. super.onCreate(savedInstanceState);
  16.  
  17. eight.setOnClickListener(new View.OnClickListener() {
  18. public void onClick(View v) {
  19. MediaPlayer mp = MediaPlayer.create(MainActivity .this,R.raw.eightsound);
  20. mp.start();
  21. }
  22. });
  23. }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement