focus search returned a view that wasn't able to take focus!【已更新】

狄旻
2023-12-01

问题表现

在开发中遇到一个偶现的崩溃,日志堆栈如下:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.edittextdemo, PID: 9528
    java.lang.IllegalStateException: focus search returned a view that wasn't able to take focus!
        at android.widget.TextView.onKeyUp(TextView.java:7591)
        at android.view.KeyEvent.dispatch(KeyEvent.java:2788)
        at android.view.View.dispatchKeyEvent(View.java:11780)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1845)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1845)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1845)
        at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1845)
        at an
 类似资料: