2

The new API 7.1 now support round Icons

We can create both versions circular and square on AndroidManifest, but how to know if the device accepts android:roundIcon?

To use programmatically R.mipmap.ic_launcher or R.mipmap.ic_launcher_round

I used this version check:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
    builder.setLargeIcon(BitmapFactory.decodeResource(context,
                         R.mipmap.ic_launcher_round));
} else {
    builder.setLargeIcon(BitmapFactory.decodeResource(context,
                         R.mipmap.ic_launcher));
}

But this do not work for some devices like Nexus with Android 7.1, just on Google Pixel, It depends on the device build configuration.

How to check it? Thanks

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Gabriel Pereira
  • 580
  • 5
  • 9

0 Answers0