Merge "Ensure preference icon is returned when inflated from XML even if it has not been displayed yet." into cw-f-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
02014a62ab
@@ -719,6 +719,9 @@ public class Preference implements Comparable<Preference> {
|
||||
* @see #setIcon(Drawable)
|
||||
*/
|
||||
public Drawable getIcon() {
|
||||
if (mIcon == null && mIconResId != 0) {
|
||||
mIcon = getContext().getDrawable(mIconResId);
|
||||
}
|
||||
return mIcon;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user