Loading...

How to Increase the Integer Value When Screen is Touched

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:

How to Increase Integer Value When Screen is Touched

Tutorial 9114379794125313899
Home item