summaryrefslogtreecommitdiff
path: root/graphics/java/android/renderscript/RenderScript.java
diff options
context:
space:
mode:
authorMark Brophy <mbrophy@google.com>2011-08-01 16:24:44 +0100
committerMark Brophy <mbrophy@google.com>2011-08-01 16:32:03 +0100
commit1ea6889136cdad8fc01de0665b3a16a4dcb259fe (patch)
tree200f54117167ee5fac6607b0b55f035744262a6d /graphics/java/android/renderscript/RenderScript.java
parentae65c17959042edd5f1b44e7653d1a775bbfceec (diff)
Fix exception when a focused item is detached.
When a ListView has itemsCanFocus set, and scrolling moves the currently focused item off the display, its focus is cleared. This is checked by calling getDistanceToView(). However, it's possible that the view will have been recycled. If so, it will have been detached from the parent by calling ViewGroup.detachViewFromParent. Since this doesn't clear the view's focus, we'll still try to call getDistanceFromView(), causing an IllegalArgumentException since the view is not a descendant of the ListView anymore. Check whether the view is still a descendant before calling getDistanceToView(). If it's not, we also need to clear the focus. Bug: 4556022 Change-Id: Iebee56032223b70d714e2ec3bb7a19093ab5f81c
Diffstat (limited to 'graphics/java/android/renderscript/RenderScript.java')
0 files changed, 0 insertions, 0 deletions