Both activities are in the same package
Second activity uses second layout file
setContentView(R.layout.main2);
Errors on this line
I got the same error while trying to print integer value : TextView.setText(int value). I resolved this error by converting the integer value to string and the i used TextView.setText(converted string value)