为什么应用程序的名称与主 activity 标签的名称相同,即使 **intent-filter** 具有标签属性

Why the name of the app is the same as the name of the main activity label even that the **intent-filter** has an label attribute

出现在主屏幕上的应用名称与主activity标签的名称相同,我在intent-filter[=24中添加了标签属性=] 但什么都没有改变。

Manifest.xml:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".RingtonesActivity"
        android:label="@string/ringtones_activity_label"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter android:label="@string/app_name">
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <receiver
        android:name=".PhoneState.PhoneStateReceiver"
        android:enabled="true"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.PHONE_STATE" />
        </intent-filter>
    </receiver>
</application>

应用的名字还是@string/ringtones_activity_label.

怎么了?

只需将应用程序名称保留在标签中,如果您想将标题设置为 activity,您可以通过

以编程方式执行此操作
getSupportActionBar().setTitle("Your title");

您必须更改 activity 标签中标签的值

<activity
    android:label="Your title, displayed on the home screen"