diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java index e70760daa0105..71369624141de 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java @@ -747,7 +747,10 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene super.dispatchStartTemporaryDetach(); // Detach the EditText temporarily such that it doesn't get onDetachedFromWindow and // won't lose IME focus. - detachViewFromParent(mEditText); + final int iEditText = indexOfChild(mEditText); + if (iEditText != -1) { + detachViewFromParent(iEditText); + } } @Override