温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Android - Manifest 文件 详解

发布时间:2020-06-15 00:25:25 来源:网络 阅读:523 作者:morndragon 栏目:移动开发

Manifest 文件 详解


本文地址: http://blog.csdn.net/caroline_wendy/article/details/20899281


Manifest可以定义应用程序及其组件需求的结构和元数组.

Android的文档: http://developer.android.com/guide/topics/manifest/manifest-element.html

Hello_World, AndroidManifest.xml :

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="mzx.spike.hello_world.app" >      <application         android:allowBackup="true"         android:icon="@drawable/ic_launcher"         android:label="@string/app_name"         android:theme="@style/AppTheme" >         <activity             android:name="mzx.spike.hello_world.app.MainActivity"             android:label="@string/app_name" >             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                  <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>     </application>  </manifest> 

xmlns:xml namespace的简写, android的命名空间;

package: 程序使用的包的名称;

application: manifest必须包含(must contain)的结点, 使用各种属性来指定应用程序的各种元数据;

activity: application的可选标签, 声明一个活动(Activity的子类), 实现应用程序得视觉用户接口(visual user interface)的部分功能;

intent-filter: 目的过滤器, 启动该activity的Intent(目的);

action: intent-filter的必选(must contain)标签, 目的过滤器的活动;

category: intent-filter的可选(can contain)标签, 目的过滤器的种类;


其中action和category里面, name属性的意思, 在Intent文档里面有标注;

文档: http://developer.android.com/reference/android/content/Intent.html


Manifest还可以使用Android Manifest Editor(Eclipse)进行管理XML, 界面化管理;

在Android Studio暂时没有此类功能;


Android - Manifest 文件 详解

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI