Java Examples for com.jaredrummler.android.processes.sample.utils.Utils.drawableToBitmap

The following java examples will help you to understand the usage of com.jaredrummler.android.processes.sample.utils.Utils.drawableToBitmap. These source code samples are taken from different open source projects.

Example 1
Project: AndroidProcesses-master  File: AppIconRequestHandler.java View source code
private Bitmap getFullResIcon(Resources resources, int iconId) {
    final Drawable drawable;
    try {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
            drawable = resources.getDrawableForDensity(iconId, dpi, null);
        } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
            drawable = resources.getDrawableForDensity(iconId, dpi);
        } else {
            drawable = resources.getDrawable(iconId);
        }
    } catch (Resources.NotFoundException e) {
        return getFullResDefaultActivityIcon();
    }
    return drawableToBitmap(drawable);
}