2017-08-14 54 views
-3

致命異常:java.lang.IndexOutOfBoundsException:無效索引5,尺寸爲1 在java.util.ArrayList.throwIndexOutOfBoundsException(ArrayLis enter code here t.java:255) 在java的.util.ArrayList.get(ArrayList.java:308) at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:230) at android.widget.AbsListView.obtainView(AbsListView.java:2351) at android.widget .ListView.makeAndAddView(ListView.java:1816) at android.widget.ListView.fillDown(ListView.java:697) at android.widget.ListView.fillGap(ListView.java:661) at android.widget.Ab s.View.trackMotionScroll(AbsListView.java:5520) at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3403) at android.widget.AbsListView.onTouchMove(AbsListView.java:3750) at android.widget.AbsListView。 onTouchEvent(AbsListView.java:3591) at android.view.View.dispatchTouchEvent(View.java:7823) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2344) at android.view.ViewGroup.dispatchTouchEvent( ViewGroup.java:2068) 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2350) 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2083) 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup中。 java:2350) a t android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2083) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2350) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2083) at android .view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2350) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2083) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2350) at android.view .ViewGroup.dispatchTouchEvent(ViewGroup.java:2083) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2350) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2083) at android.view.ViewGroup .dispatchTransformedTouchEvent(ViewGroup中。的java:2350) 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2083) 在android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2350) 在android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java: 2083) 在com.android.internal.policy.impl.PhoneWindow $ DecorView.superDispatchTouchEvent(PhoneWindow.java:2216) 在com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1563) 在android.app.Activity.dispatchTouchEvent(Activity.java:2552) at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60) at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper。 java:60) at com.android.interna (View.RootImpl.java:l.policy.impl.PhoneWindow $ DecorView.dispatchTouchEvent(PhoneWindow.java:2164) at android.view.View.dispatchPointerEvent(View.java:8003) at android.view.ViewRootImpl $ ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java: 4215) 在android.view.ViewRootImpl $ ViewPostImeInputStage.onProcess(ViewRootImpl.java:4094) 在android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java:3652) 在android.view.ViewRootImpl $ InputStage.onDeliverToNext( ViewRootImpl.java:3706) at android.view.ViewRootImpl $ InputStage.forward(ViewRootImpl.java:3675) at android.view.ViewRootImpl $ AsyncInputStage.forward(ViewRootImpl.java:3786) at android.view.ViewRootImpl $ InputStage.apply(ViewRootImpl.java:3683) at android.view。ViewRootImpl $ AsyncInputStage.apply(ViewRootImpl.java:3843) 在android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java:3652) 在android.view.ViewRootImpl $ InputStage.onDeliverToNext(ViewRootImpl.java:3706) 在android.view.ViewRootImpl $ InputStage.forward(ViewRootImpl.java:3675) at android.view.ViewRootImpl $ InputStage.apply(ViewRootImpl.java:3683) at android.view.ViewRootImpl $ InputStage.deliver(ViewRootImpl.java: 3652) 在android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5928) 在android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5877) 在android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5848) at android.view.ViewRootImpl $ WindowInputEventReceiver.onInputE通風口(ViewRootImpl.java:6008) 在android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185) 在android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(InputEventReceiver.java) 在android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver。 Java的:176) 在android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:5981) 在android.view.ViewRootImpl $ ConsumeBatchedInputRunnable.run(ViewRootImpl.java:6027) 在android.view.Choreographer $ CallbackRecord.run( Choreographer.java:761) at android.view.Choreographer.doCallbacks(Choreographer.java:574) at android.view.Choreographer.doFrame(Choreographer.java:542) at android.view.Choreographer $ FrameDisplayEventR eceiver.run(Choreographer.java:747) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper。循環(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5590) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method。調用(Method.java:515) at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1268) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)at dalvik.system.NativeStart.main(NativeStart.java)的Android java.lang.IndexOutOfBoundsException HeaderViewListAdapter.java線

+0

您的問題是什麼? – Hans1984

+0

你應該解釋你的問題是什麼。添加一個問題,然後我們可以嘗試幫助你。 – Ivan

+0

我最近開始從Crashlytics看到崩潰報告,並提供以下跟蹤信息。不知道如何修復它。 – Sumit

回答

0

您的listitem inflation in listview正在拋出這個。您正在嘗試訪問數組中只有一個大小的第五個元素。而不是靜態地嘗試獲取值,通過使用位置字段動態使用listview

相關問題