check if there is an available activity for handling open_document_tree intent
This commit is contained in:
parent
ee0e2bf2dc
commit
edaace5d94
1 changed files with 7 additions and 1 deletions
|
@ -10,6 +10,7 @@ import android.view.View
|
|||
import android.view.WindowManager
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.EditText
|
||||
import com.simplemobiletools.commons.R
|
||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||
import com.simplemobiletools.commons.dialogs.DonateDialog
|
||||
import com.simplemobiletools.commons.dialogs.WhatsNewDialog
|
||||
|
@ -41,7 +42,12 @@ fun Activity.isShowingSAFDialog(file: File, treeUri: String, requestCode: Int):
|
|||
if (resolveActivity(packageManager) == null) {
|
||||
type = "*/*"
|
||||
}
|
||||
|
||||
if (resolveActivity(packageManager) != null) {
|
||||
startActivityForResult(this, requestCode)
|
||||
} else {
|
||||
toast(R.string.unknown_error_occurred)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue