diff --git a/CHANGELOG.md b/CHANGELOG.md index f4171bf6c02..171abdbec5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +Changelog for ownCloud Android Client [unreleased] (UNRELEASED) +======================================= +The following sections list the changes in ownCloud Android Client unreleased relevant to +ownCloud admins and users. + +[unreleased]: https://github.com/owncloud/android/compare/v2.21.0...master + +Summary +------- + +* Bugfix - Fix crash when opening from details screen: [#3696](https://github.com/owncloud/android/pull/3696) + +Details +------- + +* Bugfix - Fix crash when opening from details screen: [#3696](https://github.com/owncloud/android/pull/3696) + + Fixed a crash when opening a non downloaded file from the details view. + + https://github.com/owncloud/android/pull/3696 + Changelog for ownCloud Android Client [2.21.0] (2022-06-07) ======================================= The following sections list the changes in ownCloud Android Client 2.21.0 relevant to diff --git a/changelog/unreleased/3696 b/changelog/unreleased/3696 new file mode 100644 index 00000000000..e3627f28422 --- /dev/null +++ b/changelog/unreleased/3696 @@ -0,0 +1,5 @@ +Bugfix: Fix crash when opening from details screen + +Fixed a crash when opening a non downloaded file from the details view. + +https://github.com/owncloud/android/pull/3696 diff --git a/owncloudApp/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java b/owncloudApp/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java index 5dd81b7baa1..bfba94062c1 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/owncloudApp/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -281,7 +281,12 @@ public boolean onOptionsItemSelected(MenuItem item) { return true; } case R.id.action_open_file_with: { - mContainerActivity.getFileOperationsHelper().openFile(getFile()); + if (!getFile().isDown()) { // Download the file + Timber.d("%s : File must be downloaded before opening", getFile().getRemotePath()); + ((FileDisplayActivity) mContainerActivity).startDownloadForOpening(getFile()); + } else { + mContainerActivity.getFileOperationsHelper().openFile(getFile()); + } return true; } case R.id.action_remove_file: { @@ -305,7 +310,7 @@ public boolean onOptionsItemSelected(MenuItem item) { } case R.id.action_send_file: { // Obtain the file - if (!getFile().isDown()) { // Download the file + if (!getFile().isDown()) { // Download the file Timber.d("%s : File must be downloaded", getFile().getRemotePath()); ((FileDisplayActivity) mContainerActivity).startDownloadForSending(getFile()); } else {