I try to add two methods for getDrawable(), because this method is deprecated. What's wrong?
public class Misc {
@TargetApi(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
public static Drawable getDrawable(Context context, int resource) {
return context.getResources().getDrawable(resource, null);
}
@TargetApi(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
public static Drawable getDrawable(Context context, int resource) {
return context.getResources().getDrawable(resource);
}
}
Duplicate method getDrawable(Context, int) in type Misc line 11 Java Problem
Duplicate method getDrawable(Context, int) in type Misc line 16 Java Problem