异常记录,一个系统层面的错误
错误堆栈如下,
java.lang.ClassCastException: android.widget.HeaderViewListAdapter cannot be cast to a.c.h.f.a.k
at a.c.h.g.va$a.onKeyDown(SourceFile:9)
at android.view.KeyEvent.dispatch(KeyEvent.java:2929)
at android.view.View.dispatchKeyEvent(View.java:13456)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1928)
at android.widget.ListView.dispatchKeyEvent(ListView.java:2413)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1933)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1933)
at android.widget.PopupWindow$PopupDecorView.dispatchKeyEvent(PopupWindow.java:2621)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5769)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:5637)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5085)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5138)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5104)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5261)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5112)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5318)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5085)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5138)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5104)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5112)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5085)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5138)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5104)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5261)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5112)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5318)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5085)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5138)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5104)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5112)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5085)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5138)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5104)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5261)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5112)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5318)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5085)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:7993)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:7944)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:7898)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:8186)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:233)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:363)
at android.os.Looper.loop(Looper.java:173)
at android.app.ActivityThread.main(ActivityThread.java:8210)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
这个错误比较隐蔽,属于系统层面的错误,不是我们程序的错误。只在虚拟机上面存在。复现步骤是,
使用虚拟机,弹出界面右上角的菜单(使用 OptionItemMenu),然后按下键盘的方向键可以报错。
错误出现的位置是弹出菜单内部,类型转换错误。