How to enable and disable button in Android

//To Disable a button
submit = (Button) findViewById(R.id.submit);
submit.setEnabled(false);

//To Enable a button
submit = (Button) findViewById(R.id.submit);
submit.setEnabled(true);