validating EditText input
<p>Trying to confirm that an EditText tool is not empty when the user clicks a button. Whenever the EditText is not blank the code works. But whenever it is blank my program crashes. Any ideas what I'm doing wrong? Thanks.</p>

<pre><code>if (et1.getText().toString() != null) {   

     inpt_weight = Integer.parseInt(et1.getText().toString()); 
     Toast.makeText(getBaseContext(), "weight is not null", Toast.LENGTH_LONG).show(); 


      } else { 

        inpt_weight = 0;
        Toast.makeText(getBaseContext(), "weight is null", Toast.LENGTH_LONG).show(); 

      };
</code></pre>
