0

I want change the launcher icon but it doesn't change it. I followed the instruction in other SO post.

What's wrong in my code? Thanks in advance.

enter image description hereenter image description here

This is the manifest:

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">
Zoe
  • 27,060
  • 21
  • 118
  • 148

2 Answers2

5

In short:

  • You are changing the legacy launcher PNG, but you are viewing your app on a newer device which uses adaptive launcher icons.

Android API 26 introduced the concept of Adaptive icons. Instead of supplying the icon and background in one PNG (per DPI size), we now supply the icon as a "foreground" image, and the "background" resource seperately.

This allows the launcher app to choose whichever shape of background it is configured for, and use that with your icon overlaid.

For backwards compatibility, we still supply to usual PNG, which will be used on pre-API 26 devices. This is what you are changing, but the changes will not be visible on the device you are testing with as it is displaying adaptive icons.

Your change would be visible on an older device.


To use these new launchers, go to Android Studio menu File... New... Image Assets.

Choose "Launcher Icons (Adaptive and Legacy)" - this will show you the new UI giving you options to change the foreground, background and legacy resources.


Note that if you don't supply any of the adaptive resources, API 26-27 will display your legacy icon as you designed it.

API 28 changes that and your legacy icon will be shrunk by the launcher, and placed inside a default white background to match the style chosen. This would look as if you had chosen a white background layer and a smaller foreground layer in the adaptive wizard.


Here's the info from the Android Developer docs:

Richard Le Mesurier
  • 29,432
  • 22
  • 140
  • 255
0

Android API 26 introduced the concept of Adaptive icons. Instead of supplying the icon and background in one PNG (per DPI size), we now supply the icon as a "foreground" image, and the "background" resource seperately.

This allows the launcher app to choose whichever shape of background it is configured for, and use that with your icon overlaid.

For backwards compatibility, we still supply to usual PNG, which will be used on pre-API 26 devices. This is what you are changing, but the changes will not be visible on the device you are testing with as it is displaying adaptive icons.

Your change would be visible on an older device.

To use these new launchers, go to Android Studio menu File... New... Image Assets.

Choose "Launcher Icons (Adaptive and Legacy)" - this will show you the new UI giving you options to change the foreground, background and legacy resources.

Note that if you don't supply any of the adaptive resources, API 26-27 will display your legacy icon as you designed it.

API 28 changes that and your legacy icon will be shrunk by the launcher, and placed inside a default white background to match the style chosen. This would look as if you had chosen a white background layer and a smaller foreground layer in the adaptive wizard.

Here's the info from the Android Developer docs:

Adaptive icons

Pramesh Bhalala
  • 273
  • 1
  • 3
  • 9