3.7 AndroidManifest.xml

In this section, you’ll modify the AndroidManifest.xml file to specify that this app’s Activity supports only a device’s portrait orientation and that the virtual keyboard should always be displayed when the Activity first appears on the screen or navigates back to the Activity. To open the manifest, double click AndroidManifest.xml in the Project window’s manifests folder. Figure 3.19 shows the completed manifest with our changes highlighted—the rest of the file was autogenerated by Android Studio when we created the app’s project. We’ll discuss some aspects of the manifest here. For a list of all the elements a manifest may contain, their attributes and their values, visit

Fig. 3.19 AndroidManifest.xml contents

Get Android How to Program, 3/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.