关于有些同学遇到查看完图片点击返回列表没有数据问题,我这边给出解决办法,还有是IndexOutOf下标越界问题
liqiangCoding opened this issue · comments
lq_coding commented
ImageDataSource类里面加上if (data.getCount() > 0 && allImages.size() > 0)判断
列表没有数据问题把while(data.moveToNext)判断改为
if (data != null && data.moveToFirst()){
do{
...........
}while(data.moveToNext);
}
DOPO commented
每次返回后间距变宽解决办法:
ImageGridActivity.onImagesLoaded() 方法中的
`mRecyclerAdapter.setOnImageItemClickListener(this);
mRecyclerView.setLayoutManager(new GridLayoutManager(this, 3));
mRecyclerView.addItemDecoration(new GridSpacingItemDecoration(3, Utils.dp2px(this, 2), false));
mRecyclerView.setAdapter(mRecyclerAdapter);`
移至onCreate() 中,adapter初始化后面就行
hy20160705 commented
该给你一朵小红花
嘎嘣脆糖 commented
index问题可以引用这个库,我发布了一下,顺便改了这个bug
implementation 'com.github.Jimmuy:ImagePicker:v1.0.3'
lq_coding commented
0.6.1吧