System adaptation of Android heterogeneous models: the app name defined by application is not consistent with the name displayed on the desktop after it is installed on the mobile phone

System adaptation of Android heterogeneous models: the app name defined by application is not consistent with the name displayed on the desktop after it is installed on the mobile phone

This kind of situation will appear on some domestic bizarre customized Android models. Normally, the name of the android App displayed under the desktop icon is determined by the android:label attribute value of the application in Android manifest.xml, for example:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="app.zhangphil.app">

    <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=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


After the App is installed on the mobile phone, the name displayed on the desktop of Android mobile device is the App name value defined in res/values/string.xml in advance, which is the normal display result.
However, some third-party mobile phone manufacturers may cause unexpected results after the second bizarre customization of Android system. For example, android:label in application defines the name of App, but the desktop displays a cached or any other name in the past.
The solution to this problem: you can restart the mobile phone to try. Or set the MAIN activity as LAUNCHER in Androidmanifest.xml to the same android:label value as the application, that is, add the same android:label to the Activity started as MAIN LAUNCHER, for example:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="app.zhangphil.app">

    <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=".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>

 

Keywords: Android Mobile xml encoding

Added by j007w on Mon, 06 Jan 2020 03:26:57 +0200