title: EditText Integer Comparing
body: <p>I am encountering problems when comparing input integer from EditText. I cant find what is wrong with it. Please help me. Here is the code below.</p>
  
  <pre><code>    protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
          setContentView(R.layout.problem2);
          textIn = (EditText) findViewById(R.id.probText);
          Button ans3 = (Button) findViewById(R.id.answer3);
  
  
  
          ans3.setOnClickListener(new View.OnClickListener() {
  
              public void onClick(View v) {
                  // TODO Auto-generated method stub
                  String probString = textIn.getText().toString();
                  Integer probInt = Integer.parseInt(probString);
                  Integer prob = 31;
                  if (probInt.equals(prob)) {
                      Toast toast = Toast.makeText(answer3.this,"CORRECT!",Toast.LENGTH_SHORT);
                      toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
                      toast.show();
                      startActivity(new Intent("com.sample.androidsample.ANSWER4")    );
  
                  } else {
                      Toast toast = Toast.makeText(answer3.this,"Wrong answer! Try again.",Toast.LENGTH_SHORT);
                      toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
                      toast.show();
                  }
              }
          });
  }
  </code></pre>