diff options
| author | 2009-07-14 15:35:55 -0700 | |
|---|---|---|
| committer | 2009-07-14 15:35:55 -0700 | |
| commit | 30d86e5143d01815763f8c28b0fc72b0493ea9f8 (patch) | |
| tree | 2a66b075fd505a533364e0f6fc56b2ccca7c417b | |
| parent | 4caac2bb4c8616edf8224408931ffc0e532537de (diff) | |
| parent | e8b165253d03d67b30850cedee15e1214a453cb4 (diff) | |
Merge change 7124 into donut
* changes:
Fixes #1977685. Prevent crash when the soft keyboard is brought up.
| -rw-r--r-- | core/java/android/view/ViewRoot.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index 6bcb135f6633..eab3799a9059 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -1367,6 +1367,15 @@ public final class ViewRoot extends Handler implements ViewParent, // is non-null and we just want to scroll to whatever that // rectangle is). View focus = mRealFocusedView; + + // When in touch mode, focus points to the previously focused view, + // which may have been removed from the view hierarchy. The following + // line checks whether the view is still in the hierarchy + if (focus == null || focus.getParent() == null) { + mRealFocusedView = null; + return false; + } + if (focus != mLastScrolledFocus) { // If the focus has changed, then ignore any requests to scroll // to a rectangle; first we want to make sure the entire focus |