Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. package com.example.my_rabby;
  2.  
  3. import android.support.v7.app.ActionBarActivity;
  4. import android.content.Intent;
  5. import android.os.Bundle;
  6. import android.view.Menu;
  7. import android.view.MenuItem;
  8. import android.view.View;
  9. import android.widget.Button;
  10. import android.media.MediaPlayer;
  11.  
  12. public class MenuPageActivity extends ActionBarActivity {
  13.  
  14. static MediaPlayer music;
  15. @Override
  16. protected void onCreate(Bundle savedInstanceState) {
  17. super.onCreate(savedInstanceState);
  18. setContentView(R.layout.activity_menu_page);
  19.  
  20. @SuppressWarnings("unused")
  21. Button button=(Button)findViewById(R.id.ins_button);
  22. music=MediaPlayer.create(MenuPageActivity.this,R.raw.jingle);
  23. music.start();
  24. }
  25.  
  26. public void Instruction(View v)
  27. {
  28. Intent intent=new Intent(this,InstructionActivity.class);
  29. startActivity(intent);
  30. //finish();
  31. }
  32.  
  33. public void HealthyTips(View v)
  34. {
  35. Intent intent=new Intent(this,HealthyTipActivity.class);
  36. startActivity(intent);
  37. //finish();
  38. }
  39. public void SelectLevel(View v)
  40. {
  41. Intent intent=new Intent(this,SelectLevelActivity.class);
  42. startActivity(intent);
  43. finish();
  44. }
  45.  
  46. public void TakeCareRabby(View v)
  47. {
  48. Intent intent=new Intent(this,TakeCareRabbyActivity.class);
  49. startActivity(intent);
  50. //finish();
  51. }
  52. @Override
  53. public boolean onCreateOptionsMenu(Menu menu) {
  54. // Inflate the menu; this adds items to the action bar if it is present.
  55. getMenuInflater().inflate(R.menu.menu_page, menu);
  56. return true;
  57. }
  58.  
  59. @Override
  60. public boolean onOptionsItemSelected(MenuItem item) {
  61. // Handle action bar item clicks here. The action bar will
  62. // automatically handle clicks on the Home/Up button, so long
  63. // as you specify a parent activity in AndroidManifest.xml.
  64. int id = item.getItemId();
  65. if (id == R.id.action_settings) {
  66. return true;
  67. }
  68. return super.onOptionsItemSelected(item);
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement