Android 基础(一)、androidmanifest.xml

来源:互联网 发布:企业淘宝开店费用明细 编辑:程序博客网 时间:2024/06/05 14:26

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 application
  • category 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 icon
  • android:label="@string/app_name": app’s name

androidmanifest一共有哪些元素?

  1. Service
    服务,sevice属性也包含class和label,此外也包含intent_filter
  2. BroadcastReceiver
    广播,has an intent-filter
  3. uses-permission
    权限
  4. application
    包含activity,指明图标
  5. activity
  6. intent-filter
0 0
原创粉丝点击