From c10e3960d9107f8663daa842ac57dedded4736e3 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Tue, 2 Dec 2014 14:58:08 -0800 Subject: Deprecate Resources.getDrawable(int) in favor of the two-arg version This is a landmine for developers. If they need to obtain an unthemed drawable, they should be using an explicit null theme. BUG: 18579576 Change-Id: Ibca6b4c3e8e50dca144571244e035caec6fa91f8 --- core/java/android/content/res/Resources.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/java') diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index 78d3e9c..a359c31 100644 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -744,7 +744,10 @@ public class Resources { * @throws NotFoundException Throws NotFoundException if the given ID does * not exist. * @see #getDrawable(int, Theme) + * @deprecated Use {@link #getDrawable(int, Theme)} instead. */ + @Deprecated + @Nullable public Drawable getDrawable(int id) throws NotFoundException { final Drawable d = getDrawable(id, null); if (d != null && d.canApplyTheme()) { @@ -769,6 +772,7 @@ public class Resources { * @throws NotFoundException Throws NotFoundException if the given ID does * not exist. */ + @Nullable public Drawable getDrawable(int id, @Nullable Theme theme) throws NotFoundException { TypedValue value; synchronized (mAccessLock) { -- cgit v1.1