The documentation did not mention anything about this. And after thinking through the problem, I figured that the Run configuration in the Android Studio needs to be told to run the app's activity. The following steps show how to change the Run Configuration.
- In Android Studio, select Edit Configuration.
The Run/Debug Configuration dialog box appears.
- In the Activity group box, toggle on Launch. Then click browse [...].
The Select Activity Class dialog appears.
- Select the desired app's activity e.g. MainActivity. Click OK.
- Click OK.
- In Android Studio, run the app again.
This time, the correct activity with the added button appears.