This repository was archived by the owner on Oct 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
common/src/main/java/com/itsaky/androidide/fragments
resources/src/main/res/values Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import androidx.core.provider.DocumentsContractCompat.buildDocumentUriUsingTree
39
39
import androidx.core.provider.DocumentsContractCompat.getTreeDocumentId
40
40
import androidx.documentfile.provider.DocumentFile
41
41
import androidx.fragment.app.Fragment
42
+ import com.itsaky.androidide.common.R
42
43
import com.itsaky.androidide.resources.R.string
43
44
import com.itsaky.androidide.utils.flashError
44
45
import java.io.File
@@ -106,7 +107,11 @@ open class BaseFragment @JvmOverloads constructor(contentLayoutId: Int = 0) :
106
107
107
108
protected fun pickDirectory (dirCallback : OnDirectoryPickedCallback ? ) {
108
109
this .callback = dirCallback
109
- this .startForResult.launch(Intent (Intent .ACTION_OPEN_DOCUMENT_TREE ))
110
+ try {
111
+ this .startForResult.launch(Intent (Intent .ACTION_OPEN_DOCUMENT_TREE ))
112
+ } catch (e: Exception ) {
113
+ requireActivity().flashError(getString(R .string.msg_dir_picker_failed, e.message))
114
+ }
110
115
}
111
116
112
117
fun interface OnDirectoryPickedCallback {
Original file line number Diff line number Diff line change 541
541
<string name =" idepref_java_diagnosticEnabled_title" >Diagnostics enabled</string >
542
542
<string name =" idepref_java_diagnosticsEnabled_summary" >(EXPERIMENTAL) Whether the Java source files should be analyzed for errors or not.</string >
543
543
<string name =" title_reload_color_schemes" >Reload color schemes</string >
544
+ <string name =" msg_dir_picker_failed" >Failed to start directory picker : %1$s</string >
544
545
</resources >
You can’t perform that action at this time.
0 commit comments