This is the same example as Android Example 2. All I have done is, I just rearrange the code to show you an Private Inner class to show the button's OnClickListener
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