I was developing an app, and I got into this:

FirstActivity:

```java
EditText inputCorrect = findViewById(R.id.inputCorrect);
Button calcButton = findViewById(R.id.calculateButton);

try {
    int correctAmount = Integer.parseInt(inputCorrect.getText().toString());
    Intent resultPage = new Intent(getApplicationContext(),resultActivity.class);
    resultPage.putExtra("c_a",correctAmount);
    calcButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            startActivity(resultPage);
        }
    });
} catch (NumberFormatException nfe) {
}

```

SecondActivity:

```java
Bundle myIntent = getIntent().getExtras();
int value =myIntent.getInt("c_a");

```

I wanted to pass an int through these activities, but when I press the button it doesn't work.

If I put the button void out of `try{ }`,it doesn't detect `resultPage`.

Any ideas? thank you so much.