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.

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.

Java Activity File
Modified code of MainActivity.java file looks like this.

Now, run your application and touch on the screen to increase integer value.


How to Increase Integer Value When Screen is Touched

Post a Comment

Powered by Blogger.