diff --git a/app/src/main/java/com/dazuoye/filemanager/compose/ui/SearchFileColumn.kt b/app/src/main/java/com/dazuoye/filemanager/compose/ui/SearchFileColumn.kt index b2dff6a..e2284c9 100644 --- a/app/src/main/java/com/dazuoye/filemanager/compose/ui/SearchFileColumn.kt +++ b/app/src/main/java/com/dazuoye/filemanager/compose/ui/SearchFileColumn.kt @@ -1,5 +1,6 @@ package com.dazuoye.filemanager.compose.ui +import android.content.ActivityNotFoundException import android.content.Context import android.content.Intent import android.widget.Toast @@ -195,7 +196,11 @@ class SearchFileColumn( val intent = Intent(Intent.ACTION_VIEW) intent.setDataAndType(uri, WrappedFile(file).mime) intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) - context.startActivity(intent) + try { + context.startActivity(intent) + }catch (e: ActivityNotFoundException){ + Toast.makeText(context,"无打开此应用的程序", Toast.LENGTH_SHORT).show() + } } } }