In this tutorial, I will show how to increase the integer value on the click of a button. The default value I have mentioned is 0 and when you click the plus button the integer value is increased by 1.
XML Layout File
Create a XML Layout with a TextView and a Button.
Java Activity File
Following is the final code of MainActivity.java file.
Now, run your application and click the increase button.