Skip to content

Commit

Permalink
Use lateinit for createFile
Browse files Browse the repository at this point in the history
  • Loading branch information
MateusRodCosta committed Feb 9, 2024
1 parent ddfe0b2 commit 881cf58
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import com.mateusrodcosta.apps.share2storage.utils.getUriData
import com.mateusrodcosta.apps.share2storage.utils.saveFile

class DetailsActivity : ComponentActivity() {
private var createFile: ActivityResultLauncher<String>? = null
private lateinit var createFile: ActivityResultLauncher<String>
private var uriData: UriData? = null

private var skipFileDetails: Boolean? = null
Expand All @@ -52,7 +52,7 @@ class DetailsActivity : ComponentActivity() {
getPreferences()
handleIntent()
val launchFilePicker = {
createFile?.launch(uriData?.displayName ?: "")
createFile.launch(uriData?.displayName ?: "")
}

setContent {
Expand Down Expand Up @@ -82,7 +82,7 @@ class DetailsActivity : ComponentActivity() {
}

private fun handleIntent() {
if (intent?.action == Intent.ACTION_SEND) {
if (intent.action == Intent.ACTION_SEND) {
val fileUri: Uri? =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) intent.getParcelableExtra(
Intent.EXTRA_STREAM,
Expand Down

0 comments on commit 881cf58

Please sign in to comment.