
Observe that, after adding Button control to the Design you will see one entry appeared under the Component Tree panel under ConstraintLayout. You will see the text BUTTON appeared on the Button control. Android Studio will add a Button control to the Design window. And then select the “ Add to Design” menu item. Select Button control and right-click on it. Android Studio will display a list of Button controls. To add the Button control select Buttons. Select the Design View and select the appropriate device for preview from the “ Device for Preview (D)” field which is on the top of the Design View. You can see this file in Android view under app -> res -> layout. What to do now is add a Button to the Activity and then press the button will display the “Hello, World!” message.

You will see the blank screen once your Project is opened in the Emulator. Once the Activity is added Build & Run the Project.

Refer to this Article to learn how to add an Activity “ Android Studio – LoginActivity – Add Login Activity to Android Project“. Once the Project Build is completed when you attempt to Run the Project you will see below Error message as NO Default Activity is added to the Project: Once the Project is created, Android Studio will start to build the Project. While creating the Project in the “Add an Activity to Mobile” wizard select “Add No Activity”. In this article, we will discuss Adding a Button to the Activity and adding a Button handler to display the “ Hello, World!” text.

We have discussed Core Components in Android in my previous Article “ Android Programming – Core Components“.
