INNER CODE UNIT · Kotlin

openSystemFilePicker

romanvht/ByeByeDPI · app/src/main/java/io/github/romanvht/byedpi/activities/FileActivity.kt:220

    private fun openSystemFilePicker() {
        try {
            externalRequestActive = true
            systemFileLauncher.launch(systemFileIntent())
        } catch (exception: Exception) {
            Log.e(TAG, "Failed to open system file picker", exception)
            externalRequestActive = false
            showStorageAccessDialog()
        }
    }

    private fun systemFileIntent(): Intent {
        val action = if (mode == MODE_CREATE) {
            Intent.ACTION_CREATE_DOCUMENT
        } else {
            Intent.ACTION_OPEN_DOCUMENT
        }
        val intent = Intent(action)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…