Buttons

#android#tutorial

Creating a button is similar to text except that it also uses a Listener callback function that is called as soon as the button is pressed.

menuButton = (Button) findViewById(R.id.menubutton);menuButton.setOnClickListener(new OnClickListener() {    //@Override    public void onClick(View v) {  // onClick Method                        //Do something when clicked                    }});   

all writing