title: Checking if EditText is empty
body: <p>I'm just trying to check if EditText is empty or not...<br>
  I have:</p>
  
  <pre><code>EditText a, b, c;
  double A, B, C;
  </code></pre>
  
  <p>And also:</p>
  
  <pre><code>a = (EditText) findViewById(R.id.a);
  b = (EditText) findViewById(R.id.b);
  c = (EditText) findViewById(R.id.c);
  </code></pre>
  
  <p>And of course:</p>
  
  <pre><code>if (a.getText().length() == 0)
      Toast.makeText(this, "Ax^2 Cannot Be Empty!", Toast.LENGTH_LONG).show();
  else {
      A = Double.parseDouble(a.getText().toString());
  
      if (b.getText().length() == 0)
          B = 0;
      else
          B = Double.parseDouble(b.getText().toString());
  
      if (c.getText().length() == 0)
          C = 0;
      else
          C = Double.parseDouble(c.getText().toString());
  
      Intent act = new Intent(this, PopupResult.class);
      act.putExtra("A", A);
      act.putExtra("B", B);
      act.putExtra("C", C);
      startActivity(act);
  }
  </code></pre>
  
  <p>It's really weird because the 1st <code>if</code> (the one with the <code>a</code>) works.<br>
  Help Please!<br><br>
  If the 1st <code>EditText</code> is empty, so there is a Toast, just like I wanted. But if the 2nd or the 3rd <code>EditText</code> are empty, the app crashes.<br>
  I want to set <code>B</code> and <code>C</code> to 0 if the fields are empty.</p>