Code example for Button

Methods: setEnabled

0
public class DownloaderDemo extends Activity {
  private Button b=null;
  private Handler handler=new Handler() {
    @Override 
    public void handleMessage(Message msg) { 
      b.setEnabled(true); 
       
      Toast 
        .makeText(DownloaderDemo.this, "Download complete!", 
                   Toast.LENGTH_LONG) 
        .show(); 
    } 
  }; 
   
  @Override 
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
     
    b=(Button)findViewById(R.id.button);
  }