1

I managed to get my adaptive icons working by creating a folder mipmap-anydpi and placing suggested xml file there (https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive.html#studio)

This worked on api 26, but broke icons on android versions lower than that, they now show default android image. I managed to fix this by renaming my folder to mipmap-anydpi-v26, now icons work as expected on all supported apis.

My question is this, are we supposed to do it like this? Will -v26 make it also work on api 27+ or I have to create separate -v2X folder for each future api?

Ilja
  • 44,142
  • 92
  • 275
  • 498

1 Answers1

3

When you create a folder or a ressource file for a specific screen density or android version, this file becomes, in your case, the default reference for this version and the versions above.

Hope this helps.

Cochi
  • 2,199
  • 2
  • 12
  • 15
  • In a way, I guess my main goal here is to make sure api 26+ uses adaptive icon and ones below that use standard one. thus far I was only able to achieve it with approach above, I'm not sure if it is future proofed however due to explicit v26 naming I had to add to that folder. – Ilja Mar 14 '18 at 11:16
  • 1
    With the v26 naming , it is future proof for api 26 and further until Google change the behavior. – Cochi Mar 14 '18 at 12:40