java.lang.ArrayIndexOutOfBoundsException 长度=42;index=42 android.text.Layout$HorizontalMeasurementProvider.get(Layout.java:1416)

java.lang.ArrayIndexOutOfBoundsException length=42; index=42 android.text.Layout$HorizontalMeasurementProvider.get(Layout.java:1416)

提问人:zhej 提问时间:12/15/2020 更新时间:12/15/2020 访问量:445

问:

感觉就像是系统中的一个错误。如何解决这个问题

android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2600)
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2600)
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2600)
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2600)
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968)
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2600)
com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:448)
com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1829)
android.app.Activity.dispatchTouchEvent(Activity.java:3307)
androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(SourceFile:69)
com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:410)
android.view.View.dispatchPointerEvent(View.java:12016)
android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4809)
android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4623)
android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4161)
android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4214)
android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4180)
android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4307)
android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4188)
android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4364)
android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4161)
android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4214)
android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4180)
android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4188)
android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4161)
android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6682)
android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6656)
android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6617)
android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6785)
android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:187)
android.os.MessageQueue.nativePollOnce(Native Method)
android.os.MessageQueue.next(MessageQueue.java:325)
android.os.Looper.loop(Looper.java:142)
android.app.ActivityThread.main(ActivityThread.java:6501)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

它看起来像系统中的一个错误。我不知道为什么。我找不到相应的解决方案。他们中的一些人遇到了相位问题

ArrayIndexOutOfBoundsException

评论

0赞 Ken White 12/15/2020
这不是系统中的错误。长度为 42 的数组的有效索引为 0 到 41,因此索引为 42 会超出数组边界。这是基本的 Java。
0赞 zhej 12/16/2020
这并没有具体告诉我哪一行代码是错误的。这意味着 textview 中存在问题。我该如何解决
0赞 meetme 3/14/2022
@zhej 面临类似的问题。你能找到解决方案吗?

答: 暂无答案