title: Validating multiple EditTexts
body: <p>Been stuck on this all night and there just doesn't seem to be an easy solution to it. I'm trying to validate all 4 of my fields to ensure that there is a value in each one of them, if there's a value in each one of them after I click the Calculate button a total will be calculated. If any of them don't have a value in them it'll return an error at every EditText which doesn't have a value and a total will not be calculated.</p>
  
  <pre><code>cal.setOnClickListener(new View.OnClickListener()
          {
  
              @Override
              public void onClick(View v) 
              {
                  // TODO Auto-generated method stub  
                  if( eLoan.getText().toString().length() == 0 )
                  {
                      eLoan.setError( "A value is required" );
                  }
                  else if( eWage.getText().toString().length() == 0 )
                  {
                      eWage.setError( "A value is required" );
                  }
                  else if( eGrant.getText().toString().length() == 0 )
                  {
                      eGrant.setError( "A value is required" );
                  }
                  else if( eOther.getText().toString().length() == 0 )
                  {
                      eOther.setError( "A value is required" );
                  }
                  else
                  convertToString();
                  converToDouble();               
                  inTotal = inLoan + inWage + inGrant + inOther;
                  DecimalFormat currency = new DecimalFormat(".00");
                  TotalInNum.setText("£" + currency.format(inTotal));
              }
  
          });
  </code></pre>
  
  <p>I can't get my head around it, I've tried to incorporate a boolean statement to check each EditText but it didn't work either. I'm convinced there's an easier method to do this.</p>
  
  <p>I'm quite new to android, self teaching myself it so I would appreciate it if people could advise me on what I'm doing wrong and maybe give me an example of what I should do.</p>
  
  <p>Thanks to all who respond.</p>