title: (Android) Views array simple form validator
body: <p>I wrote this simple form validator to see if an EditText field is empty or not. I'm calling this method from a fragment, but it always seems to pass the if statement even while it's empty. Here's my code:</p>
  
  <pre><code> private boolean checkForm() {
                  boolean returnValue = false;
                  View[] view1;
                  view1 = new View[] {(EditText) rootView.findViewById(R.id.name),
                          (EditText) rootView.findViewById(R.id.companyname),
                          (EditText) rootView.findViewById(R.id.email),
                          (EditText) rootView.findViewById(R.id.website),
                          (EditText) rootView.findViewById(R.id.other),
                          (EditText) rootView.findViewById(R.id.whichelements)
                  };
                  for(View item : view1)
                  {
                      if(item.toString().trim().length() &gt; 0){
                          returnValue = true;
                      }
                      else
                      {
                          returnValue = false;
                          break;
                      }
                  }
                  return returnValue;
              }
  </code></pre>
  
  <p>When I debug it also says the string is empty which you can see here at the mTransformed: <a href="http://gyazo.com/cfd58bc075b5cfbf01c0bce5f8702a15" rel="nofollow">http://gyazo.com/cfd58bc075b5cfbf01c0bce5f8702a15</a></p>
  
  <p>Why is the condition always true, even when the string is not empty? String.Equals() also doesn't work</p>