diff --git a/src/api-impl/android/content/Context.java b/src/api-impl/android/content/Context.java index e3d0e537..06343b61 100644 --- a/src/api-impl/android/content/Context.java +++ b/src/api-impl/android/content/Context.java @@ -637,7 +637,7 @@ public class Context extends Object { } public final Drawable getDrawable(int resId) { - return getResources().getDrawable(resId); + return getResources().getDrawable(resId, getTheme()); } public boolean isRestricted() { return false; } diff --git a/src/api-impl/android/content/res/Resources.java b/src/api-impl/android/content/res/Resources.java index 9175645b..99c6258f 100644 --- a/src/api-impl/android/content/res/Resources.java +++ b/src/api-impl/android/content/res/Resources.java @@ -710,6 +710,10 @@ public class Resources { * @return Drawable An object that can be used to draw this resource. */ public Drawable getDrawable(int id) throws NotFoundException { + return getDrawable(id, null); + } + + public Drawable getDrawable(int id, Theme theme) throws NotFoundException { TypedValue value; synchronized (mAccessLock) { value = mTmpValue; @@ -722,7 +726,7 @@ public class Resources { } Drawable res = null; try { - res = loadDrawable(value, id); + res = loadDrawable(value, id, theme); } catch (NotFoundException e) { e.printStackTrace(); } synchronized (mAccessLock) { if (mTmpValue == null) { @@ -732,10 +736,6 @@ public class Resources { return res; } - public Drawable getDrawable(int id, Theme theme) throws NotFoundException { - return getDrawable(id); - } - /** * Return a drawable object associated with a particular resource ID for the * given screen density in DPI. This will set the drawable's density to be