OC-299 fixed restart of finished downloads on orientation changes

This commit is contained in:
David A. Velasco 2013-06-10 13:52:24 +02:00
parent 93f79c7099
commit 64bbf07d97

View file

@ -379,19 +379,21 @@ public class FileDisplayActivity extends FileActivity implements
detailsFragment.updateFileDetails(true, false); detailsFragment.updateFileDetails(true, false);
} else if (downloadEvent.equals(FileDownloader.DOWNLOAD_FINISH_MESSAGE)) { } else if (downloadEvent.equals(FileDownloader.DOWNLOAD_FINISH_MESSAGE)) {
// update the right panel // update the right panel
if (success && waitedPreview) { boolean detailsFragmentChanged = false;
mWaitingToPreview = mStorageManager.getFileById(mWaitingToPreview.getFileId()); // update the file from database, for the local storage path if (waitedPreview) {
if (PreviewMediaFragment.canBePreviewed(mWaitingToPreview)) { if (success) {
startMediaPreview(mWaitingToPreview, 0, true); mWaitingToPreview = mStorageManager.getFileById(mWaitingToPreview.getFileId()); // update the file from database, for the local storage path
if (PreviewMediaFragment.canBePreviewed(mWaitingToPreview)) {
} else { startMediaPreview(mWaitingToPreview, 0, true);
detailsFragment.updateFileDetails(false, (success)); detailsFragmentChanged = true;
openFile(mWaitingToPreview); } else {
openFile(mWaitingToPreview);
}
} }
mWaitingToPreview = null; mWaitingToPreview = null;
}
} else { if (!detailsFragmentChanged) {
detailsFragment.updateFileDetails(false, (success)); detailsFragment.updateFileDetails(false, (success));
} }
} }