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:
parent
8cf9117cb6
commit
4f55f6dbec
1 changed files with 4 additions and 7 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue