SoFunction
Updated on 2025-03-10

How to implement Android App to change the icons

How to implement Android App to change the icons

Generally speaking, we set the App icon in it and specify it through the Application android:icon property, and the writing method is as follows:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:andro
  package="">

  <application
    android:name=".ApplicationContext"
    android:allowBackup="false"
    android:icon="@drawable/app_icon"
    android:label="@string/app_name"
    android:theme="@style/BaseTheme">

    ....
    .....

  </application>
</manifest>

As the new year is approaching, the product needs to change an application icon for the latest version. OK, it will be done in one minute. As above, just replace the app_icon.png icon.

However, the test students found that after replacing the icon, the previous icons still displayed on mobile phones such as Xiaomi 5, Huawei 6plus, LeTV 1S, Xiaomi 2s, and Meizu MX5.

Take tricks to deal with:

Re-specify the new icon through the application portal Activity android:icon property. Currently, the test has been passed, and the actual tests have basically taken effect in a timely manner (except for some models with their own themes). The writing method is as follows:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:andro
  package="">

  <application
    android:name="."
    android:allowBackup="false"
    android:icon="@drawable/app_icon"
    android:label="@string/app_name"
    android:theme="@style/BaseTheme">

    ....

    <activity
      android:name="."
      android:icon="@drawable/new_app_icon"
      android:launchMode="singleTop"
      android:screenOrientation="portrait"
      android:theme="@style/"
      android:configChanges="keyboardHidden|orientation|screenSize">
      <intent-filter>
        <action android:name="" />
        <category android:name="" />
      </intent-filter>
    </activity>


    .....

  </application>
</manifest>

Through the entranceActivity android:icon="@drawable/new_app_icon" Point to the new app icon.

The above is a detailed explanation of the example of Android changing icons. If you have any questions, please leave a message or go to the community of this site to communicate and discuss. Thank you for reading. I hope it can help you. Thank you for your support for this site!