ImagePicker icon indicating copy to clipboard operation
ImagePicker copied to clipboard

选择图片页面时,当屏幕熄灭后,再次打开 出现崩溃

Open KevinWard0910 opened this issue 6 years ago • 1 comments

崩溃原因:java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 最终走到了 ImageDataSource——>onLoadFinished()方法 ——> 130行 allImagesFolder.cover = allImages.get(0); 操作方式:在图片选择页面,熄灭屏幕,然后打开屏幕,随后崩溃 测试手机:红米3 android 6.0 猜想:应该和图片选择页面的生命周期有关。 希望大神有时间看看

KevinWard0910 avatar Jul 18 '18 08:07 KevinWard0910

dvzhou commented 29 days ago if ((activity.getLifecycle().getCurrentState() == STARTED || activity.getLifecycle().getCurrentState() == RESUMED) && imageFolders.size() > 0) { return; }

这样以后应该就没问题了

flyjiang2014 commented 24 days ago if ((activity.getLifecycle().getCurrentState() == STARTED || activity.getLifecycle().getCurrentState() == RESUMED) && imageFolders.size() > 0) { return; } 这句代码加在哪里,加在 imageFolders.clear(); 前面吗?

dvzhou commented 24 days ago 是的

JustinChiang123 avatar Jul 20 '18 02:07 JustinChiang123