androidmanifest.xml讲解
很多activity,service,broadcast的各种信息需要被打包起来用于安卓程序的执行,这种任务的机制就是androidmanifest
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
action android:name="android.intent.action.MAIN"indicates that this is an entry point to the applicationcategory android:name="android.intent.category.LAUNCHER"places this Activity in the launcher(发射台)window
<application android:icon="@drawable/icon">
<activity android:name=".chapter1" android:label="@string/app_name">
......
</activity>
</application>
android:icon="@drawable/icon"indicates that this application uses icon as iconandroid:label="@string/app_name": app’s name
androidmanifest一共有哪些元素?
- Service
服务,sevice属性也包含class和label,此外也包含intent_filter - BroadcastReceiver
广播,has an intent-filter - uses-permission
权限 - application
包含activity,指明图标 - activity
- intent-filter
本文详细解读AndroidManifest.xml文件中activity、service、broadcast、permission和application等元素的配置及作用,包括intent-filter、class、label等关键属性,并探讨如何在Android应用中正确使用这些配置。
2091

被折叠的 条评论
为什么被折叠?



