Similar to how a website is made up of multiple webpages, an android app comprises multiple user interfaces. For example, an app for an online store may have separate user interfaces for the homepage, products, checkout and support sections. The content of each user interface is organised by a layout. This tutorial will cover how to create user interface layouts and use buttons to navigate between them.
When you start a new project, Android Studio will often create an XML file called activity_main.xml by default. This is the user interface layout the app will load first (unless advised otherwise). To create another layout click Project > app > res and right-click the layout folder. Select New > Layout resource file.
In the New Resource File window enter the file name for the new layout (e.g. 'second_layout') then press OK. The other options can be left at their default values in this example.
Android Studio will now create and open a new file called second_layout.xml (or the file name you entered). The file can be found in the layout folder alongside the activity_main.xml file.
x10hosting offers free and fast web hosting as well as other extras for your website such as custom email address and SQL databases. Creating a free or premium account using this link will help support this site.