title: Converting from Editable to int in android
body: <p>I want to convert the type <code>Editable</code> from an android <code>EditText</code> to the type integer to do maths operations on a user input number</p>
  
  <p>I tried the following:</p>
  
  <pre><code>int x=(int)R2.getText().toString();
  </code></pre>
  
  <p>but it gives me an error of cannot convert a string to int.</p>