Both activities are in the same package
Second activity uses second layout file
setContentView(R.layout.main2);
Errors on this line
For me I had to go in the XML file for the button. There I noticed a hard coded string value. I had to remove that, and also I had to use Textview.setText("" + intVar);
Textview.setText("" + intVar);