Code example for Button

Methods: setEnabled

0
 
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
 
		mOkButton = getButton(BUTTON_POSITIVE);
		mOkButton.setEnabled(false);
	} 
 
 
	public void onClick(DialogInterface dialog, int which) {
		switch (which) {
		case BUTTON_POSITIVE:
			verifyAndSavePreferences(); 
			boolean create_account = mCreateAccount.isChecked();
			mainWindow.startConnection(create_account);
			break; 
		case BUTTON_NEUTRAL:
			verifyAndSavePreferences(); 
			mainWindow.startActivity(new Intent(mainWindow, AccountPrefs.class));
			break; 
Experience pair programming with AI  Get Codota for Java