5.9. AndroidManifest.xml
Each Activity
in an app must be declared in the app’s AndroidManifest.xml
file; otherwise, Android will not know that the Activity
exists and will not be able to launch it. When you created the app, the IDE declared its MainActivity
in AndroidManifest.xml
. To declare the app’s SettingsActivity
:
1. Open AndroidManifest.xml
and click the Application tab at the bottom of the manifest editor.
2. In the Application Nodes section, click Add..., select Activity from the dialog that appears and click OK.
3. In the Application Nodes section, select the new Activity node to display its attributes in the Attributes for Activity section.
4. In the Name field, enter .SettingsActivity
. The dot (.
) before SettingsActivity
is shorthand ...
Get Android™ How to Program, Second Edition 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.