- xx
- Components
All components that will be created by Android system must be declared in Manifest, such as Activity, Service, Content providers, Broadcast receivers that initialized by system (such as BOOT_CIMPLETE), Broadcast receivers used by PendingIntent (Such as that used by AlarmManager). But the broadcast receivers register/unregister by yourself need not be declared in Manifest
- android:taskAffinity
Specify the id of task to house this Activity.
Activities with the same affinity conceptually belong to the same task (to the same "application" from the user's perspective). The affinity of a task is determined by the affinity of its root activity.
More details: http://blog.chinaunix.net/space.php?uid=8735300&do=blog&id=2211556
- android:launchMode
(
http://developer.android.com/guide/topics/manifest/activity-element.html#lmode
)
"singleTask" and ""singleInstance", should be used ONLY when the activity has an ACTION_MAIN and a CATEGORY_LAUNCHER filter. (Please
refer to the section 'Starting a task' at
http://developer.android.com/guide/topics/fundamentals/tasks-and-back-stack.html)
- standard
Default. The system always creates a new instance of the activity in the
target task and routes the intent to it. - singleTop
If an instance of the activity already exists at the top of
the target task,
the system routes the intent to that instance, rather than creating a
new instance of the activity. If instance doesn't exist, or the existing
instance is not the top of the target task, the system will create a
new instance - singleTask
If an instance of the activity already exists, the system
routes the intent to existing instance, rather than creating a
new one. - singleInstance
Same as "singleTask", except that the system doesn't launch any
other activities into the task holding the instance. The activity is always the
single and only member of its task.
- android:configChanges
Lists configuration changes that the activity will handle itself, rather than to shut down and restarte it by default. - android:screenOrientation
Set the orientation of the activity's display.
If you set its value to be 'landscape' or 'portrait',
you'd better to append 'orientation' to 'android:configChanges' to
prevent the activity benig restarted after system orientation is
changed. - android:label
A user-readable label for the activity. It will is displayed on activity's title. Furthermore, if the activity contains the following intent-filter:
the label will be displayed on Program list as application's name.
If this attribute is not set, that in will be used by default.
- xxx
- xxx
- Permission
Requests a permission that the application must be granted in order for it to operate correctly.
Android pre-defines a list of permissions, you can find them at
http://developer.android.com/reference/android/Manifest.permission.html
If you need to request a permission defined by other application (not Android SDK), you must use to declare it in your AndroidManifest.xml first. ie, if a content provider application defines the following permission:
android:name="xxxxx"
android:authorities="xxxx"
android:readPermission="com.xxx.provider.permission.READ"
android:writePermission="com.xxx.provider.permission.WRITE">
Your application need to read & write model the content provider, you must request permissions as following:
com.xxx.provider.permission.READ" />
com.xxx.provider.permission.WRITE" />
com.xxx.provider.permission.READ/>
com.xxx.provider.permission.WRITE" />
Declares a security permission that can be used to limit access
to specific components or features of this or other applications.
- Ref:
http://developer.android.com/guide/topics/manifest/manifest-intro.html#perms
- Tips
- Component name of inner class in Manifest
Must use '$' instead of '.' between outter class and inner class. i.e.:
package com.compony.utils;
public class OutterClass extends AClass
{
public class InnerClass extends Activity
{
}
}
Then you can use the class OutterClass in Manifest as following:
android:name="com.compony.utils.OutterClass$InnerClass"
- xxx
- Reference:
- http://developer.android.com/guide/topics/manifest/manifest-intro.html
阅读(884) | 评论(0) | 转发(0) |