Skip to content

Commit 4495172

Browse files
author
duyu
committed
修复图片压缩失败后错误问题
1 parent 5931218 commit 4495172

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

library/src/main/java/com/rain/library/ui/PhotoPickActivity.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,14 @@ protected void onCreate(Bundle savedInstanceState) {
8585
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
8686
requestPermission();
8787
else init();
88-
89-
//获取全部媒体文件
90-
loadMediaData();
9188
}
9289

9390
/**
9491
* 初始化控件
9592
*/
9693
private void init() {
94+
//获取全部媒体文件
95+
loadMediaData();
9796

9897
loadingDialog = new LoadingDialog(this);
9998

@@ -286,10 +285,10 @@ public void onSuccess(File file, boolean success) {
286285
finish();
287286
}
288287
} else {
289-
index++;
290288
MediaData photo = adapter.getSelectPhotosInfo().get(index);
291289
photo.setCompressed(true);
292290
photo.setCompressionPath(photo.getOriginalPath());
291+
index++;
293292
}
294293
}
295294
};

0 commit comments

Comments
 (0)