How to disable the button in the form until the user fill the important fields
<p>i have Form that the user will fill it, 
But, i have some field that the user should fill it : 
-case name
-CaseAge
-CaseDurationH, CaseDurationM (it is for time)
-GenderSelection
then the user also should fill CasePic or CaseClothes
if the user fill these 5 important fields then the Next button will be enabled otherwise it will be disabled.</p>

<p>and this is My code, but it is not complete, because i do not hava any idea how to complete it!</p>

<pre><code> public class TestActivity extends Activity {
/** Called when the activity is first created. */
EditText edit1;
EditText edit2;
EditText edit3;
Button button;
String test1;
 RadioGroup GenderSelection;
 Spinner CaseDurationH, CaseDurationM;


@Override
protected void onCreate(Bundle savedInstanceState) {
    // Your initialization code...
    // TODO Auto-generated method stub
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);

            edit1= (EditText) findViewById(R.id.edit1);
            edit2= (EditText) findViewById(R.id.edit2);
            GenderSelection = (RadioGroup) findViewById(R.id.radioGroup);
            button=(Button) findViewById(R.id.button);
            CaseDurationH = (Spinner) findViewById(R.id.Shr);
            CaseDurationM = (Spinner) findViewById(R.id.Smin);


   TextWatcher watcher = new LocalTextWatcher();
    edit1.addTextChangedListener(watcher);
    edit2.addTextChangedListener(watcher);
    //radiogroup();
    int id = GenderSelection.getCheckedRadioButtonId();

    if (id == -1){
        //no item selected
        button.setEnabled(false);
    }
    else{
        if (id == R.id.radio0){
            //Do something with the button
            button.setEnabled(true);
        }  else{
            if (id == R.id.radio1){
                //Do something with the button
                button.setEnabled(true);
            } else{
                if (id == R.id.radio2){
                    //Do something with the button
                    button.setEnabled(true);
                }

    updateButtonState();}}}
}

void updateButtonState() {
    boolean enabled;
    if(checkEditText(edit1) &amp;&amp; checkEditText(edit2)) button.setEnabled(false);
    else button.setEnabled(true);
        }

private boolean checkEditText(EditText edit) {
    return edit.getText().length() == 0;
}

      private class LocalTextWatcher implements TextWatcher {
    public void afterTextChanged(Editable s) {
        updateButtonState();
    }

    public void beforeTextChanged(CharSequence s, int start, int count,
            int after) {
        // TODO Auto-generated method stub

    }

    public void onTextChanged(CharSequence s, int start, int before,
            int count) {
        // TODO Auto-generated method stub  
    }}}
</code></pre>
