Java EditText Validation Not Working
<p>I am trying to validate user input from a form before submit but it is allowing all empty fields to go through... any ideas? I tried "" instead of null as well...</p>

<pre><code>    public void onClick(View v) {
               EditText agencyname = (EditText) findViewById(R.id.agencyname);
               String agency = agencyname.getText().toString();
                EditText firstname = (EditText) findViewById(R.id.firstname);
                String first = firstname.getText().toString();
                EditText lastname = (EditText) findViewById(R.id.lastname);
                String last = lastname.getText().toString();
                EditText phone = (EditText) findViewById(R.id.phone);
                String agencyphone = phone.getText().toString();
                EditText email = (EditText) findViewById(R.id.email);
                String agencyemail = email.getText().toString();
                if(agency != null || first != null || last != null || agencyphone != null || agencyemail != null){
            Intent i = new Intent();
            i.setClassName("android.com.smartchoice", "android.com.smartchoice.AgencyRecieve");
            i.putExtra("agencyname", agency);
            i.putExtra("phone", agencyphone);
            i.putExtra("email", agencyemail);
            i.putExtra("firstname", first);
            i.putExtra("lastname", last);
            startActivity(i);
                }
                else
                {
                    Toast.makeText(NewAgencyActivity.this, "Must Input All Fields", Toast.LENGTH_LONG).show();
                };


        }
</code></pre>
