Java tutorial
//package com.java2s; // Use of this source code is governed by a BSD-style license that can be import android.content.Context; import android.content.pm.PackageManager; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Process; public class Main { /** * @see android.content.pm.PackageManager#getUserBadgedDrawableForDensity(Drawable drawable, * UserHandle user, Rect badgeLocation, int badgeDensity). */ public static Drawable getUserBadgedDrawableForDensity(Context context, Drawable drawable, Rect badgeLocation, int density) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { PackageManager packageManager = context.getPackageManager(); return packageManager.getUserBadgedDrawableForDensity(drawable, Process.myUserHandle(), badgeLocation, density); } return drawable; } }