Skip to content

Commit 5a4945d

Browse files
committed
Partially enhance and revert 8271da3
During tests, we found out that some devices have problems with the resolveActivity check
1 parent a100bd0 commit 5a4945d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

presentation/src/main/java/org/cryptomator/presentation/presenter/BrowseFilesPresenter.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -555,16 +555,15 @@ class BrowseFilesPresenter @Inject constructor( //
555555
val cryptomatorApp = activity().application as CryptomatorApp
556556
cryptomatorApp.suspendLock()
557557
}
558-
view?.showProgress(ProgressModel.COMPLETED)
559-
if (viewFileIntent.resolveActivity(context().packageManager) != null) {
558+
try {
560559
requestActivityResult(ActivityResultCallbacks.openFileFinished(openFileType), viewFileIntent)
561-
} else {
560+
} catch (e: ActivityNotFoundException) {
562561
view?.showFileTypeNotSupportedDialog(cloudFile)
563562
}
564563
}
565564

566-
override fun onError(e: Throwable) {
567-
super.onError(e)
565+
override fun onFinished() {
566+
view?.showProgress(ProgressModel.COMPLETED)
568567
}
569568
})
570569
}

0 commit comments

Comments
 (0)