title: get Integer value from EditText Android
body: <p>This is my <code>activity.xml</code></p>
  
  <pre><code>&lt;EditText
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:id="@+id/inputnumber"
   android:inputType="number" /&gt;
  </code></pre>
  
  <p>this is <code>mainactivity.java</code> :</p>
  
  <pre><code>EditText num = (EditText) findViewById(R.Id.inputnumber) ;
  </code></pre>
  
  <p>the question is how can I get the integer value from this field as an integer and use it for example in a custom class I made like this to add 1 to the value of this input field? </p>
  
  <p>my customclass.java</p>
  
  <pre><code>public static int addone(int a) 
  {
    int b = a+1;
    return b;
  }
  </code></pre>