title: Getting a decimal number from EditText on Android Studio
body: <p>EDIT:Solved!</p>
  
  <p>I know this has been posted before, but the answers I've seen from those are not working for me.</p>
  
  <p>I'm trying to get the input from one textfield (which i've specified as a decimal input) but can't think of any other way to get the value of it other than to toString it.  </p>
  
  <p>What I have below crashes and the error logs say  </p>
  
  <p>java.lang.IllegalStateException: Could not execute method of the activity</p>
  
  <pre><code>public void buttonOnClick(View v){
      // do something when the button is clicked
  
      Double inputNum;
  
      TextView mField = (TextView) findViewById(R.id.mField);
      TextView kmField = (TextView) findViewById(R.id.kmField);
  
      if(mField.length() &gt; 0){
          inputNum = ( Double.valueOf(kmField.getText().toString()) )/ 0.62137;
          mField.setText(inputNum.toString());
      }
  }
  </code></pre>