title: Disabling Android Button if Text Fields Empty
body: <p>Can someone tell me how to disable a button in Android unless all three editText fields are filled? I'm not sure where to include a conditional statement here and how to place it in the context of the button listener.</p>
  
  <p>Here's my main activity code.</p>
  
  <pre><code>package com.amritayalur.mypowerschool;
  
  
  
  import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.text.method.ScrollingMovementMethod;
  import android.view.Gravity;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.view.inputmethod.InputMethodManager;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.TextView;
  
  
  
  public class MyPowerSchoolActivity extends Activity {
  Button buttonSubmit;
  TextView textViewTitle;
  TextView textViewDesc;
  EditText editTextURL, editTextUser, editTextPass;
  
  String url = "";
   String str;
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
  
      buttonSubmit = (Button) findViewById(R.id.buttonSubmit);
      textViewTitle = (TextView) findViewById(R.id.textViewTitle);
      textViewDesc = (TextView) findViewById(R.id.textViewDesc);
  
      editTextURL = (EditText) findViewById(R.id.editTextURL);
      editTextUser = (EditText) findViewById(R.id.editTextUser);
      editTextPass = (EditText) findViewById(R.id.editTextPass);
      //Start TextView
      textViewTitle.setText("MyPowerSchool");
  
  
      //button listener
      buttonSubmit.setOnClickListener(new View.OnClickListener() {
  
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
              Intent i = new Intent( MyPowerSchoolActivity.this, creds.class);    
              i.putExtra("pschoolurl", editTextURL.getText().toString());
              i.putExtra("pschooluser", editTextUser.getText().toString());
              i.putExtra("pschoolpass", editTextPass.getText().toString());
              // get the text here
              final int result = 1;
              startActivityForResult(i, result); 
  
          };
  
  
  
  
      });
  
  
  
  
  }       
  }
  </code></pre>