Android Android Java

Add Two Numbers in Android for Beginners2 min read

In this tutorial, we will learn, how to read 2 numbers out of 2 EditText fields, parse them into integers, add them and then display the sum in a TextView after clicking a button.

activity_main.xml Code:




MainActivity.java Code:

Output:

Leave a Comment