1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-506 Editor | Fix | Open xlsx in google sheets (#2680)

This commit is contained in:
Mikhail 2022-10-26 11:01:56 +03:00 committed by GitHub
parent 8cf9117cb6
commit 4f55f6dbec
Signed by: github
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1187,13 +1187,10 @@ open class EditorFragment : NavigationFragment<FragmentEditorBinding>(R.layout.f
private fun openFileByDefaultApp(uri: Uri) {
try {
val intent = Intent(Intent.ACTION_VIEW, uri)
.apply {
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
}
startActivity(
intent
)
val intent = Intent(Intent.ACTION_VIEW)
.setDataAndType(uri, requireContext().contentResolver.getType(uri))
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
startActivity(intent)
} catch (e: Exception) {
if (e is ActivityNotFoundException) {
toast("No application found to open the selected file")