使用Lisview多布局时报数组越界 异常java.lang.ArrayIndexOutOfBoundsException

发布时间:2019-06-29 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了使用Lisview多布局时报数组越界 异常java.lang.ArrayIndexOutOfBoundsException脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

     PRocess: xyz.magicer.ximalaya, PID: 12598
    java.lang.ArrayIndexOutOfBoundsException: length=3; index=3
    at andROId.widget.AbsListView$RecycleBin.addScrapview(AbsListView.java:6588)
    at android.widget.AbsListView.trackMotionScroll(AbsListView.java:4941)
    at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:4539)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
    at android.view.Choreographer.doCallbacks(Choreographer.java:580)
    at android.view.Choreographer.doFrame(Choreographer.java:549)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.LooPEr.loop(Looper.java:135)at android.app.ActivITyThread.main(ActivityThread.java:5254)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndargsCaller.run(ZygoteInit.java:903)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

当使用Listview的多布局时,getItemViewType需要从0开始计数,并且 getViewTypeCount要大于 getItemViewType中的数

脚本宝典总结

以上是脚本宝典为你收集整理的使用Lisview多布局时报数组越界 异常java.lang.ArrayIndexOutOfBoundsException全部内容,希望文章能够帮你解决使用Lisview多布局时报数组越界 异常java.lang.ArrayIndexOutOfBoundsException所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。