diff options
| author | 2025-03-05 10:45:59 -0800 | |
|---|---|---|
| committer | 2025-03-05 10:45:59 -0800 | |
| commit | 7f18b10b427abb63c631b772c21ff6c81b8f19ef (patch) | |
| tree | e404d7775f6392dded0dc692124b8020678033f4 | |
| parent | 55efeb245c829b8a11a7139416d499f2c41045da (diff) | |
| parent | 7c9b801f995a47b0a94f8a5c90a6a0a9791f4b00 (diff) | |
Merge "Fix IllustrationPreferenceTest failed" into main
| -rw-r--r-- | packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java b/packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java index e818a603c5b4..0c64fa7d34dd 100644 --- a/packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java +++ b/packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java @@ -138,8 +138,12 @@ public class IllustrationPreference extends Preference implements GroupSectionDi ImageView backgroundViewTablet = (ImageView) holder.findViewById(R.id.background_view_tablet); - backgroundView.setVisibility(mIsTablet ? View.GONE : View.VISIBLE); - backgroundViewTablet.setVisibility(mIsTablet ? View.VISIBLE : View.GONE); + if (backgroundView != null) { + backgroundView.setVisibility(mIsTablet ? View.GONE : View.VISIBLE); + } + if (backgroundViewTablet != null) { + backgroundViewTablet.setVisibility(mIsTablet ? View.VISIBLE : View.GONE); + } if (mIsTablet) { backgroundView = backgroundViewTablet; } |