activity 里面的 android:label 优先级 > application 里面的android:label
android:label属性 用来设定apk的名称以及activity的标题。
举例说明一下,AndroidManifest.xml内容如下:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.jimmy.demointent1">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="GoodMorning"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="MainActivity"
android:label="HelloWorld"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
请问生成的apk名称是GoodMorning 还是HelloWorld?
答案是:HelloWorld。
---- The End.