diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-22 14:49:19 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-22 14:49:19 -0700 |
commit | 4e1afc1a569d05cc6a1ee213c65ffb49513600ca (patch) | |
tree | 8aa057f52c90c8d108b6b756c09378df0cbd61e9 /core/java/android/widget/ListView.java | |
parent | 7198030fce4b54820a65a10d54fae18a1ab5df84 (diff) | |
parent | b6888167d39bbfdb3e26e12f267c6d1abc6ce2b2 (diff) | |
download | frameworks_base-4e1afc1a569d05cc6a1ee213c65ffb49513600ca.zip frameworks_base-4e1afc1a569d05cc6a1ee213c65ffb49513600ca.tar.gz frameworks_base-4e1afc1a569d05cc6a1ee213c65ffb49513600ca.tar.bz2 |
Merge change 2361 into donut
* changes:
Fixes #1872506. Prevents NPE in ListView. When the opaque property changes at runtime, it is possible to end up in a situation in which the divider's Paint instance has not been instanciated. This change simples uses a final Paint that is guaranteed to not be null.
Diffstat (limited to 'core/java/android/widget/ListView.java')
-rw-r--r-- | core/java/android/widget/ListView.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java index 6686f75..e96ab20 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -134,7 +134,7 @@ public class ListView extends AbsListView { // used for temporary calculations. private final Rect mTempRect = new Rect(); - private Paint mDividerPaint; + private final Paint mDividerPaint = new Paint(); // the single allocated result per list view; kinda cheesey but avoids // allocating these thingies too often. @@ -2824,9 +2824,6 @@ public class ListView extends AbsListView { final boolean opaque = (color >>> 24) == 0xFF; mIsCacheColorOpaque = opaque; if (opaque) { - if (mDividerPaint == null) { - mDividerPaint = new Paint(); - } mDividerPaint.setColor(color); } super.setCacheColorHint(color); |