I this Example I will make a simple button in to the main activity window. The button will have an option to press and count how many times you have pressed the button.
Step 1:
Create a Blank Activity on Android Studio. Name it anything you like.
Step 2:
Go to the layout folder and only keep activity_main.xml. If any other than activity_main.xml is created, just delete that. Now type the following lines for the layout.
Step3:
Open up your MainActivity.java file and type the following codes
Step 4:
Turn on your Emulator or GenyMotion. Run the Project and here you go .. a simple button functionality.
Step 1:
Create a Blank Activity on Android Studio. Name it anything you like.
Step 2:
Go to the layout folder and only keep activity_main.xml. If any other than activity_main.xml is created, just delete that. Now type the following lines for the layout.
Step3:
Open up your MainActivity.java file and type the following codes
Step 4:
Turn on your Emulator or GenyMotion. Run the Project and here you go .. a simple button functionality.
Post a Comment