helper method to set the background depending on the android version

@param v
@param drawableRes
428400
public static void setBackground(View v, int drawableRes) {
        setBackground(v, getCompatDrawable(v.getContext(), drawableRes));
    }
195568
public final void setBackground(@DrawableRes final int resourceId) {
        this.background = ContextCompat.getDrawable(getContext(), resourceId);
        this.backgroundBitmap = null;
        this.backgroundId = -1;
        this.backgroundColor = -1;
        adaptBackground();
    }
828761
public static void setViewBackground(View v, Drawable d) {
        if (Build.VERSION.SDK_INT >= 16) {
            v.setBackground(d);
        } else {
            v.setBackgroundDrawable(d);
        }
    }
1137553
public void setThemes_event(FSArray v) {
    if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_themes_event == null)
      jcasType.jcas.throwFeatMissing("themes_event", "ch.epfl.bbp.uima.genia.Event");
    jcasType.ll_cas.ll_setRefValue(addr, ((Event_Type)jcasType).casFeatCode_themes_event, jcasType.ll_cas.ll_getFSRef(v));}
727702
private void setChildDrawableAtIndex(int index, @Nullable Drawable drawable) {
    if (drawable == null) {
      mFadeDrawable.setDrawable(index, null);
      return;
    }
    drawable = WrappingUtils.maybeApplyLeafRounding(drawable, mRoundingParams, mResources);
    getParentDrawableAtIndex(index).setDrawable(drawable);
  }
1196353
void setDrawable(@Nullable IconicsAnimatedDrawable drawable) {
        mDrawable = null;
        onDrawableDetached();

        if (drawable != null) {
            mDrawable = drawable;
            onDrawableAttached();

            if (mIsStartImmediately || mIsStartRequested) {
                start();
            }
        } else {
            mAnimator.cancel();
        }
    }
1361132
public static void setDrawableTint(@NonNull Drawable drawable, @ColorInt int color) {
        DrawableCompat.setTint(DrawableCompat.wrap(drawable.mutate()), color);
    }
174838
public final void setDialogHeaderBackground(@Nullable final Bitmap background) {
        this.dialogHeaderBackground = new BitmapDrawable(getContext().getResources(), background);
        this.dialogHeaderBackgroundBitmap = background;
        this.dialogHeaderBackgroundId = -1;
        this.dialogHeaderBackgroundColor = -1;
    }
630096
public static Drawable getCompatDrawable(Context c, int drawableRes) {
		Drawable d = null;
		try {
			d = ContextCompat.getDrawable(c, drawableRes);
		} catch (Exception ex) {
			logException(ex);
		}
		return d;
	}
714203
public void setSelectionDrawable(@NonNull Drawable drawable) {
    if (drawable == null) {
      throw new IllegalArgumentException("Cannot be null");
    }
    selectionDrawable = drawable;
    isDecorated = true;
  }
1275133
private Drawable getDrawable(Uri uri) {
        try {
            String scheme = uri.getScheme();
            if (ContentResolver.SCHEME_ANDROID_RESOURCE.equals(scheme)) {
                // Load drawables through Resources, to get the source density information
                try {
                    return getDrawableFromResourceUri(uri);
                } catch (Resources.NotFoundException ex) {
                    throw new FileNotFoundException("Resource does not exist: " + uri);
                }
            } else {
                // Let the ContentResolver handle content and file URIs.
                InputStream stream = mProviderContext.getContentResolver().openInputStream(uri);
                if (stream == null) {
                    throw new FileNotFoundException("Failed to open " + uri);
                }
                try {
                    return Drawable.createFromStream(stream, null);
                } finally {
                    try {
                        stream.close();
                    } catch (IOException ex) {
                        Log.e(LOG_TAG, "Error closing icon stream for " + uri, ex);
                    }
                }
            }
        } catch (FileNotFoundException fnfe) {
            Log.w(LOG_TAG, "Icon not found: " + uri + ", " + fnfe.getMessage());
            return null;
        }
    }
1056836
public final void setDialogWindowBackground(@DrawableRes final int resourceId) {
        this.dialogWindowBackground = ContextCompat.getDrawable(getContext(), resourceId);
        this.dialogWindowBackgroundBitmap = null;
        this.dialogWindowBackgroundId = resourceId;
    }
1339036
@NonNull
    public IconicsDrawable backgroundColorRes(@ColorRes int colorResId) {
        return backgroundColor(ContextCompat.getColor(mContext, colorResId));
    }
333087
public void setPaletteRes(@ColorRes int primeId, @ColorRes int extraId) {
        this.primeColor = ContextCompat.getColor(getContext(), primeId);
        this.extraColor = ContextCompat.getColor(getContext(), extraId);
        pathPaint.setColor(primeColor);
        gradient = null;
    }
220286
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    public static void setNavigationBarColor(Window window, int navigationBarColor) {
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setNavigationBarColor(navigationBarColor);
    }
153272
@SuppressLint("NewApi")
    public static void setBackground(View v, Drawable d) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
            v.setBackgroundDrawable(d);
        } else {
            v.setBackground(d);
        }
    }
415825
public static void applyTheme(Drawable d, Resources.Theme t) {
        IMPL.applyTheme(d, t);
    }