How to set Button Enable and Disable using Android

Add button to layout, then add the following code java file.
   
   Button btnCalcualte=(Button) findViewById(R.id.button1);
             // to enable button             
             btnCalcualte.setEnabled(true);
               // to disable button        
              btnCalcualte.setEnabled(false);      

Post a Comment

0 Comments