2

Running on an android API 29 emulator, if you minimize an app and view the minimized list of apps, they each have an icon associated with them:

enter image description here

in my example here, there's a round chrome icon associated to google chrome at the top of the card.

My question is : how do you set this icon, what is it called and when was it introduced (I'm basically looking for documentation on it)

I've tried setting android:roundIcon="@mipmap/ic_launcher" in the manifest but it doesn't seem to apply.

Any help is much appreciated

a_local_nobody
  • 7,947
  • 5
  • 29
  • 51
  • did you tried these solutions? https://stackoverflow.com/questions/47938643/launcher-icon-is-not-shown-in-oreo-8-0-8-1 – zakjma Aug 20 '19 at 07:19
  • 1
    i didn't because our launcher icon works, but this specific icon is not displayed, but i'll have a look at it maybe i missed an icon, thank @zakjma – a_local_nobody Aug 20 '19 at 07:20

2 Answers2

2

Basically it uses adaptive icons i.e items with foreground and background set inside an xml

eg:

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
   <background android:drawable="@drawable/ic_launcher_background" />
   <foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Set this adaptive icon as your rounIcon then

Have a look at this link, it should answer your query

Adaptive icons

Kushan
  • 5,855
  • 3
  • 31
  • 45
  • sure np :) i had the exact same issue a while back so ... :D – Kushan Aug 20 '19 at 07:24
  • Adaptive launcher icons are also used in shortcuts, the Settings app, sharing dialogs, and the overview screen. ---- exact words in the link :) – Kushan Aug 20 '19 at 07:27
  • keywords for google search : android recents screen app icon in api 28 and above – Kushan Aug 20 '19 at 07:27
0

Using Android Studio - generate launcher icon as image assets. it will generate all supported format for background and foreground including launcher icon. To generate icon right click on drawable folder -> New -> Image assets.

post this check the xml files -

  1. Under mipmap -> ic_launcher_round ->ic_launcher_round.xml (anydpi-v26) - there should be entry like this -

    <?xml version="1.0" encoding="utf-8"?>
    <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
       <background android:drawable="@color/ic_launcher_background"/>
       <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
    </adaptive-icon>
    
  2. Under mipmap -> ic_launcher -> ic_launcher.xml (anydpi-v26) - there should be entry like this -

     <?xml version="1.0" encoding="utf-8"?>
     <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
           <background android:drawable="@color/ic_launcher_background"/>
           <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
     </adaptive-icon>
    
Pravind Kumar
  • 809
  • 1
  • 11
  • 10