Page 140 - 24JAM_Pintar_Pemrograman_Android__1-libre
P. 140

  24 JAM!! Pintar Pemrograman Android
            26:     /** Called when the activity is first created. */
            27:     @Override
            28:     public void onCreate(Bundle savedInstanceState) {
            29:            super.onCreate(savedInstanceState);
            30:            setContentView(R.layout.main);
            31:            EButton = (Button) this.findViewById(R.id.stringE);
            32:            EButton.setOnClickListener(new OnClickListener() {
            33:                   @Override
            34:                   public void onClick(View arg0) {
            35:                          playSound(1);
            36:                   }
            37:            });
            38:            BButton = (Button) this.findViewById(R.id.stringB);
            39:            BButton.setOnClickListener(new OnClickListener() {
            40:                   @Override
            41:                   public void onClick(View arg0) {
            42:                          playSound(2);
            43:                   }
            44:            });
            45:            GButton = (Button) this.findViewById(R.id.stringG);
            46:            GButton.setOnClickListener(new OnClickListener() {
            47:                   @Override
            48:                   public void onClick(View arg0) {
            49:                          playSound(3);
            50:                   }
            51:            });
            52:            DButton = (Button) this.findViewById(R.id.stringD);
            53:            DButton.setOnClickListener(new OnClickListener() {
            54:                   @Override
            55:                   public void onClick(View arg0) {
            56:                          playSound(4);
            57:                   }
            58:            });
            59:            AButton = (Button) this.findViewById(R.id.stringA);
            60:            AButton.setOnClickListener(new OnClickListener() {
            61:                   @Override
            62:                   public void onClick(View arg0) {
            63:                          playSound(5);
            64:                   }
            65:            });
            66:            E2Button = (Button)this.findViewById(R.id.stringE1);
            67:            E2Button.setOnClickListener(new OnClickListener() {
            68:                   @Override
            69:                   public void onClick(View arg0) {
            70:                          playSound(6);
            71:                   }
            72:            });
            73:            keluar = (Button) this.findViewById(R.id.keluar);
            74:            keluar.setOnClickListener(new OnClickListener() {
            75:                   @Override
            76:                   public void onClick(View arg0) {
            77:                          tunerGitar.this.finish();
            78:                   }
            79:            });
            80:            keterangan = (TextView)
            81:                 this.findViewById(R.id.keterangan);
            82:     }
            83:
            84:     @Override
            85:     public void onPause() {
            86:            try {
            87:                   super.onPause();
            88:                   player.pause();
            89:            } catch (Exception e) {
            90:            }
            91:     }
                              Dapatkan materi terbaru di                  140
                                       www.omayib.com
   135   136   137   138   139   140   141   142