title: how to get number input type from edittext android studio
body: <p>I have problem here,my java code is</p>
  
  <pre><code>int num = Integer.parseInt(mark.getText().toString());
  </code></pre>
  
  <p>And my xml code is </p>
  
  <pre><code>android. InputType="number"
  </code></pre>
  
  <p>But i am still getting error saying that <code>"invalid int ="""</code>
  Can anyone help me..i really really need help right now. </p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_adding_remove);
          parentLinearLayout = (LinearLayout) findViewById(R.id.parent_linear_layout);
  
          final EditText mark = (EditText)findViewById(R.id.etMark);
          EditText j = (EditText)findViewById(R.id.etJam);
          TextView status = (TextView)findViewById(R.id.tVGred);
          TextView pn = (TextView)findViewById(R.id.tvPnm);
  
  
  
          double  pointer;
          String grade;
  
         int num = Integer.parseInt(mark.getText().toString());
  
          if (num &gt;= 90 &amp;&amp; num &lt;= 100) {
              grade = "A+";
              pointer = 4.00;
              status.setText(grade);
          }
          else if (num &gt;= 80 &amp;&amp; num &lt;= 89) {
              grade = "A";
              pointer = 4.00;
              status.setText(grade);
          }
          else if (num &gt;= 75 &amp;&amp; num &lt;= 79) {
              grade = "A-";
              pointer = 3.67;
              status.setText(grade);
          }
          else if (num &gt;= 70 &amp;&amp; num &lt;= 74) {
              grade = "B+";
              pointer = 3.33;
              status.setText(grade);
  
          }
           else if (num &gt;= 65 &amp;&amp; num &lt;= 69) {
              grade = "B";
              pointer = 3.00;
              status.setText(grade);
          }
          else if (num &gt;= 60 &amp;&amp; num &lt;= 64) {
              grade = "B-";
              pointer = 2.67;
              status.setText(grade);
          }
          else if (num &gt;= 55 &amp;&amp; num &lt;= 59) {
              grade = "C+";
              pointer = 2.33;
              status.setText(grade);
          }
          else if (num &gt;= 50 &amp;&amp; num &lt;= 54) {
              grade = "C";
              pointer = 2.00;
              status.setText(grade);
          }
          else if (num &gt;= 47 &amp;&amp; num &lt;= 49) {
              grade = "C-";
              pointer = 1.67;
              status.setText(grade);
          }
          else if (num &gt;= 44 &amp;&amp; num &lt;= 46) {
              grade = "D+";
              pointer = 1.33;
              status.setText(grade);
          }
          else if (num &gt;= 40 &amp;&amp; num &lt;= 43) {
              grade = "D";
              pointer = 1.00;
              status.setText(grade);
          }
          else
          {
              grade = "F";
              pointer = 0.00;
              status.setText(grade);
          }
  
  
     }
  </code></pre>