title: Convert String in EditText to Double
body: <p>I wanted to make a little app.<br>
  What this app is supposed to do is have a running "bank account" total and there are two options: deposit money or withdraw money.<br>
  I attached the main activity class as well as the class I made for the "bank account" (I haven't implemented the history function yet as I have not figure out this part!).<br>
  Basically, this line:</p>
  
  <pre><code>bankAccount.withdrawal(Double.parseDouble(findViewById(R.id.inputWithdrawal).toString()))
  </code></pre>
  
  <p>and it's deposit counterpart is throwing a <em><code>NumberFormatException</code></em> saying it's an "Invalid Double".<br>
  I have no Idea what I've look on other threads but ihavent been able to find anything that works.  </p>
  
  <pre><code>import android.support.v7.app.AppCompatActivity;   
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.TextView;
  
  
  public class MainActivity extends AppCompatActivity {
  
      private EditText withdrawal, deposit;
      private Button withdrawalButton, depositButton;
      private BankAccount bankAccount;
      private String total;
      private TextView textViewTotal;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          withdrawal = (EditText) findViewById(R.id.inputWithdrawal);
          deposit = (EditText) findViewById(R.id.inputDeposit);
  
          withdrawalButton = (Button) findViewById(R.id.withdrawalButton);
          depositButton = (Button) findViewById(R.id.depositButton);
          withdrawalButton.setOnClickListener(onClickListener);
          depositButton.setOnClickListener(onClickListener);
  
          bankAccount = new BankAccount();
          textViewTotal = (TextView) findViewById(R.id.Total);
          updateTotal();
      }
  
      private View.OnClickListener onClickListener = new View.OnClickListener(){
          @Override
          public void onClick(View view){
              try {
                  switch (view.getId()) {
                      case R.id.withdrawalButton:
                          if (!withdrawal.getText().toString().equals("")) {
                              bankAccount.withdrawal(Double.parseDouble(findViewById(R.id.inputWithdrawal).toString()));
                              updateTotal();
                          }
                          break;
  
                      case R.id.depositButton:
                          if (!deposit.getText().toString().equals("")) {
                              bankAccount.deposit(Double.parseDouble(findViewById(R.id.inputDeposit).toString()));
                              updateTotal();
                          }
                          break;
                  }
              } catch (NumberFormatException e){
                  e.printStackTrace();
              }
          }};
  
      public void updateTotal(){
          total = "$" + bankAccount.getCheckingTotal();
          textViewTotal.setText(total);
      }  
  }
  </code></pre>
  
  <p><p></p>
  
  <pre><code>public class BankAccount {
      private double checkingTotal;
      private ArrayList&lt;String&gt; history;
  
      public BankAccount(){
          checkingTotal = 0;
          history = new ArrayList&lt;String&gt;();
      }
  
      public void withdrawal(double amount){
          checkingTotal -= amount;
          history.add("-$" + amount);
  
          if(history.size() &gt; 5)
              history.remove(0);
      }
  
      public void deposit(double amount){
          checkingTotal += amount;
          history.add("$" + amount);
  
          if(history.size() &gt; 5)
              history.remove(0);
      }
  
      public double getCheckingTotal(){
          return checkingTotal;
      }
  }
  </code></pre>