Merge "Check for null drawable in theme-less getDrawable()" into lmp-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
760cfb02de
@@ -747,7 +747,7 @@ public class Resources {
|
|||||||
*/
|
*/
|
||||||
public Drawable getDrawable(int id) throws NotFoundException {
|
public Drawable getDrawable(int id) throws NotFoundException {
|
||||||
final Drawable d = getDrawable(id, null);
|
final Drawable d = getDrawable(id, null);
|
||||||
if (d.canApplyTheme()) {
|
if (d != null && d.canApplyTheme()) {
|
||||||
Log.w(TAG, "Drawable " + getResourceName(id) + " has unresolved theme "
|
Log.w(TAG, "Drawable " + getResourceName(id) + " has unresolved theme "
|
||||||
+ "attributes! Consider using Resources.getDrawable(int, Theme) or "
|
+ "attributes! Consider using Resources.getDrawable(int, Theme) or "
|
||||||
+ "Context.getDrawable(int).", new RuntimeException());
|
+ "Context.getDrawable(int).", new RuntimeException());
|
||||||
|
|||||||
Reference in New Issue
Block a user