List of usage examples for android.graphics.drawable Icon createWithAdaptiveBitmap
public static Icon createWithAdaptiveBitmap(Bitmap bits)
From source file:com.android.contacts.DynamicShortcuts.java
private void addIconForContact(long id, String lookupKey, String displayName, ShortcutInfo.Builder builder) { Bitmap bitmap = getContactPhoto(id); if (bitmap == null) { bitmap = getFallbackAvatar(displayName, lookupKey); }/*from w ww .j a v a2s. c om*/ final Icon icon; if (BuildCompat.isAtLeastO()) { icon = Icon.createWithAdaptiveBitmap(bitmap); } else { icon = Icon.createWithBitmap(bitmap); } builder.setIcon(icon); }