Android 开发文档 程序基础——Intent filters
2010-06-17 03:20:00 来源:WEB开发网< category android:name=”android.intent.category.DEFAULT” / >
< /intent-filter >
< /activity >
. . .
< /application >
< /manifest >
The first filter in the example — the combination of the action “android.intent.action.MAIN” and the category “android.intent.category.LAUNCHER” — is a common one. It marks the activity as one that should be represented in the application launcher, the screen listing applications users can launch on the device. In other words, the activity is the entry point for the application, the initial one users would see when they choose the application in the launcher.
The second filter declares an action that the activity can perform on a particular type of data.
A component can have any number of intent filters, each one declaring a different set of capabilities. If it doesn’t have any filters, it can be activated only by intents that explicitly name the component as the target.
For a broadcast receiver that’s created and registered in code, the intent filter is instantiated directly as an IntentFilter object. All other filters are set up in the manifest.
For more on intent filters, see a separate document, Intents and Intent Filters.
出自:http://buhutuu.cn/
更多精彩
赞助商链接