Code example for Button

Methods: setEnabled

0
  protected void onActivityResult(int requestCode, int resultCode,
                                  Intent data) {
    if (requestCode == PICK_REQUEST) {
      if (resultCode == RESULT_OK) {
        contact=data.getData();
        viewButton.setEnabled(true);
      } 
    } 
  } 
 
  @Override 
  public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
 
    LinearLayout container=(LinearLayout)findViewById(R.id.container);
 
    if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
      container.setOrientation(LinearLayout.HORIZONTAL);
    } 
    else { 
Contextual code suggestions in your IDE  Get Codota for Java