How to Increase the Integer Value When Screen is Touched
http://www.viralandroid.com/2015/10/how-to-increase-the-integer-value-when-screen-is-touched.html
In this example, you will learn to increase/change the integer value when screen is touched. Here the integer value is change by one when we touch the screen.
Related:
How to Increase the Integer Value When Button is Clicked
How to Check Internet Connection Programmatically in Android
XML Layout File
Add following code in your activity_main.xml file.
res/layout/activity_main.xml
Java Activity File
Modified code of MainActivity.java file looks like this.
src/MainActivity.java
Now, run your application and touch on the screen to increase integer value.
Output:
Related:
How to Increase the Integer Value When Button is Clicked
How to Check Internet Connection Programmatically in Android
XML Layout File
Add following code in your activity_main.xml file.
res/layout/activity_main.xml
Java Activity File
Modified code of MainActivity.java file looks like this.
src/MainActivity.java
Now, run your application and touch on the screen to increase integer value.
Output: