Ensure preference icon is returned when inflated from XML even if it has not been displayed yet.
Bug: 31343032 Change-Id: Ifa2c84b3091c2cfc5b98da6f30bb1ba060cd26e7
This commit is contained in:
@@ -719,6 +719,9 @@ public class Preference implements Comparable<Preference> {
|
|||||||
* @see #setIcon(Drawable)
|
* @see #setIcon(Drawable)
|
||||||
*/
|
*/
|
||||||
public Drawable getIcon() {
|
public Drawable getIcon() {
|
||||||
|
if (mIcon == null && mIconResId != 0) {
|
||||||
|
mIcon = getContext().getDrawable(mIconResId);
|
||||||
|
}
|
||||||
return mIcon;
|
return mIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user