
上QQ阅读APP看书,第一时间看更新
How it works...
Declaring an activity is a simple matter of declaring the <activity> element and specifying the name of the activity class with the android:name attribute. By adding the <activity> element to the Android Manifest, we are specifying our intention to include this component in our application. Any activities (or any other component for that matter) that are not declared in the manifest will not be available to the application. Attempting to access or utilize an undeclared component will result in an exception being thrown at runtime.
In the preceding code, there is another attribute: android:label. This attribute indicates the title shown on the screen, as well as the icon if this is the Launcher activity.
For a complete list of available Activity attributes, take a look at this resource:
http://developer.android.com/guide/topics/manifest/activity-element.html.
http://developer.android.com/guide/topics/manifest/activity-element.html.