title: Invalid Double. Number format exception in android
body: <p>I have this in xml.</p>
  
  <pre><code>&lt;EditText
                  android:id="@+id/creditlimitfield2"
                  android:hint="0"
                  android:inputType="numberDecimal" /&gt;
  </code></pre>
  
  <p>So, the default value for edittext is 0.</p>
  
  <p>in code, I have this</p>
  
  <pre><code>creditlimit = (EditText) findViewById(R.id.creditlimitfield2);
  double credit_limit = Double.valueOf(creditlimit.getText().toString());
  </code></pre>
  
  <p>Alternately, I have tried:</p>
  
  <pre><code>double credit_limit = Double.parseDouble(creditlimit.getText().toString());
  </code></pre>
  
  <p>And</p>
  
  <pre><code>double credit_limit = new Double(creditlimit.getText().toString());
  </code></pre>
  
  <p>When I run the program, It gives the error of </p>
  
  <pre><code>Numberformatexception. Invalid double "".
  </code></pre>
  
  <p>Please be reminded that the field is not empty. Any suggestions would be helpful.</p>
  
  <hr>
  
  <p>I have seen many questions,almost similar to it, with very less answers and none of them help solving my condition. So, Please do not tag it as "Similar Question" without checking other questions too.</p>