AndroidManifest基本

2020-02-22  本文已影响0人  四月八日君尋
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.april.helloworld">//申明包名(等价于图一位置的包,或者通俗称文件夹)

    <application //应用配置
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"//配置app图标,表示引用了res包下mipmap下的ic_launcher文件(如图二)
        android:label="@string/app_name"//配置app的label,表示引用了res包下value的app_name字段(如图三)
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity"//活动配置(应该是com.april.helloworld.MainActivity,由于已经在顶部声明,这里省略的写法)
            android:label="This is first active"//活动页面title(会显示在页面顶部,可以不要)
            >
            <intent-filter>//配置为主活动
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />//作为程序启动器
            </intent-filter>
        </activity>
    </application>
</manifest>

图一、申明包位置.png 图二、引用图片资源.png 图三、字段申明与引用.png
上一篇 下一篇

猜你喜欢

热点阅读