0

I'm making a launcher app, and I can't figure out how to get the pre-android8 icon of an app. Is there a special function to get resources for a chosen API level?

Nova launcher is somehow able to get the old icons, but since it's closed source, I couldn't investigate its code.

Here's a post asking the same question, which wasn't answered

Zagura
  • 1

1 Answers1

0

I found something. Though it doesn't behave like nova launcher & I only tested it on OxygenOS:

I used the LauncherActivityInfo.getIcon(density: Int) function to get apps' icons. If you pass context.resources.configuration.densityDpi, it'll behave like a normal launcher, but if you pass zero, some apps will return a non-adaptive icon.

Zagura
  • 1