jeasonlzy / ImagePicker

完全仿微信的图片选择,并且提供了多种图片加载接口,选择图片后可以旋转,可以裁剪成矩形或圆形,可以配置各种其他的参数
Apache License 2.0
4.29k stars 1.03k forks source link

com.lzy.imagepicker.ui.ImageGridActivity: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 #246

Open kwytalent opened 6 years ago

kwytalent commented 6 years ago

java.lang.RuntimeException: Unable to resume activity {com.android.IPM/com.lzy.imagepicker.ui.ImageGridActivity}: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3505) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3545) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1578) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6245) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:900) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:790) Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.get(ArrayList.java:411) at com.lzy.imagepicker.b.a(Unknown Source) at com.lzy.imagepicker.b.a(Unknown Source) at android.support.v4.app.LoaderManagerImpl$b.a(Unknown Source) at android.arch.lifecycle.LiveData.a(Unknown Source) at android.arch.lifecycle.LiveData.b(Unknown Source) at android.arch.lifecycle.LiveData.b(Unknown Source) at android.arch.lifecycle.j.b(Unknown Source) at android.support.v4.app.LoaderManagerImpl$a.b(Unknown Source) at android.support.v4.app.LoaderManagerImpl$a.a(Unknown Source) at android.support.v4.content.e.b(Unknown Source) at android.support.v4.content.d.a(Unknown Source) at android.support.v4.content.d.i(Unknown Source) at android.support.v4.content.e.q(Unknown Source) at android.support.v4.app.LoaderManagerImpl$a.b(Unknown Source) at android.arch.lifecycle.LiveData$a.a(Unknown Source) at android.arch.lifecycle.LiveData$LifecycleBoundObserver.a(Unknown Source) at android.arch.lifecycle.f$a.a(Unknown Source) at android.arch.lifecycle.f.a(Unknown Source) at android.arch.lifecycle.f.d(Unknown Source) at android.arch.lifecycle.f.b(Unknown Source) at android.arch.lifecycle.f.a(Unknown Source) at android.arch.lifecycle.m.a(Unknown Source) at android.arch.lifecycle.m.onStart(Unknown Source) at android.app.Fragment.performStart(Fragment.java:2379) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1027) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1153) at android.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:2044) at android.app.FragmentController.dispatchStart(FragmentController.java:187) at android.app.Activity.performStart(Activity.java:6849) at android.app.Activity.performRestart(Activity.java:6917) at android.app.Activity.performResume(Activity.java:6922) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3482) ... 8 more java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.get(ArrayList.java:411) at com.lzy.imagepicker.b.a(Unknown Source) at com.lzy.imagepicker.b.a(Unknown Source) at android.support.v4.app.LoaderManagerImpl$b.a(Unknown Source) at android.arch.lifecycle.LiveData.a(Unknown Source) at android.arch.lifecycle.LiveData.b(Unknown Source) at android.arch.lifecycle.LiveData.b(Unknown Source) at android.arch.lifecycle.j.b(Unknown Source) at android.support.v4.app.LoaderManagerImpl$a.b(Unknown Source) at android.support.v4.app.LoaderManagerImpl$a.a(Unknown Source) at android.support.v4.content.e.b(Unknown Source) at android.support.v4.content.d.a(Unknown Source) at android.support.v4.content.d.i(Unknown Source) at android.support.v4.content.e.q(Unknown Source) at android.support.v4.app.LoaderManagerImpl$a.b(Unknown Source) at android.arch.lifecycle.LiveData$a.a(Unknown Source) at android.arch.lifecycle.LiveData$LifecycleBoundObserver.a(Unknown Source) at android.arch.lifecycle.f$a.a(Unknown Source) at android.arch.lifecycle.f.a(Unknown Source) at android.arch.lifecycle.f.d(Unknown Source) at android.arch.lifecycle.f.b(Unknown Source) at android.arch.lifecycle.f.a(Unknown Source) at android.arch.lifecycle.m.a(Unknown Source) at android.arch.lifecycle.m.onStart(Unknown Source) at android.app.Fragment.performStart(Fragment.java:2379) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1027) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1153) at android.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:2044) at android.app.FragmentController.dispatchStart(FragmentController.java:187) at android.app.Activity.performStart(Activity.java:6849) at android.app.Activity.performRestart(Activity.java:6917) at android.app.Activity.performResume(Activity.java:6922) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3482) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3545) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1578) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6245) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:900) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:790)

PaulLuv commented 6 years ago

解决了吗?xiong dei?

zwping commented 6 years ago

同样的问题,0.6.1,Android7.0。。。坐等

DonnyHe commented 6 years ago

+1

zwping commented 6 years ago

@DonnyHe 已经有人说明原因了,Link

本地化修改一下代码

yq2yizi commented 6 years ago

+1