Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash issue #221,#250; #251

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,11 @@ public void onPreviewComplete() {

@Override
public void onPreviewChanged(AlbumFile albumFile) {
// finish button is pressed, ignore any preview change event.
// or mCheckedList will be changed AlbumActivity's thread and GalleryActivity thread.
if (isThumbnailTaskWorking) {
return;
}
ArrayList<AlbumFile> albumFiles = mAlbumFolders.get(mCurrentFolder).getAlbumFiles();
int position = albumFiles.indexOf(albumFile);
int notifyPosition = mHasCamera ? position + 1 : position;
Expand Down Expand Up @@ -548,10 +553,12 @@ public void onBackPressed() {
callbackCancel();
}

private boolean isThumbnailTaskWorking = false;
/**
* Callback result action.
*/
private void callbackResult() {
isThumbnailTaskWorking = true;
ThumbnailBuildTask task = new ThumbnailBuildTask(this, mCheckedList, this);
task.execute();
}
Expand All @@ -566,6 +573,7 @@ public void onThumbnailStart() {
public void onThumbnailCallback(ArrayList<AlbumFile> albumFiles) {
if (sResult != null) sResult.onAction(albumFiles);
dismissLoadingDialog();
isThumbnailTaskWorking = false;
finish();
}

Expand Down