diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index c3a9fa82d..976e26caa 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts @@ -162,7 +162,7 @@ android { } dependencies { - implementation("androidx.activity:activity-ktx:1.8.2") + implementation("androidx.activity:activity-ktx:1.9.2") implementation("androidx.appcompat:appcompat:1.7.0") implementation("androidx.core:core-splashscreen:1.0.1") implementation("androidx.documentfile:documentfile:1.0.1") diff --git a/src/android/app/src/main/java/io/github/lime3ds/android/fragments/HomeSettingsFragment.kt b/src/android/app/src/main/java/io/github/lime3ds/android/fragments/HomeSettingsFragment.kt index 81af4043c..b7d7da8ec 100644 --- a/src/android/app/src/main/java/io/github/lime3ds/android/fragments/HomeSettingsFragment.kt +++ b/src/android/app/src/main/java/io/github/lime3ds/android/fragments/HomeSettingsFragment.kt @@ -159,7 +159,7 @@ class HomeSettingsFragment : Fragment() { R.string.select_lime3ds_user_folder, R.string.select_lime3ds_user_folder_home_description, R.drawable.ic_home, - { mainActivity.openLime3DSDirectory.launch(null) }, + { mainActivity?.openLime3DSDirectory?.launch(null) }, details = homeViewModel.userDir ), HomeSetting( diff --git a/src/android/app/src/main/java/io/github/lime3ds/android/fragments/Lime3DSDirectoryDialogFragment.kt b/src/android/app/src/main/java/io/github/lime3ds/android/fragments/Lime3DSDirectoryDialogFragment.kt index 42ee42f9f..6cc9e358d 100644 --- a/src/android/app/src/main/java/io/github/lime3ds/android/fragments/Lime3DSDirectoryDialogFragment.kt +++ b/src/android/app/src/main/java/io/github/lime3ds/android/fragments/Lime3DSDirectoryDialogFragment.kt @@ -60,7 +60,7 @@ class Lime3DSDirectoryDialogFragment : DialogFragment() { } .setNegativeButton(android.R.string.cancel) { _: DialogInterface?, _: Int -> if (!PermissionsHandler.hasWriteAccess(requireContext())) { - (requireActivity() as MainActivity).openLime3DSDirectory.launch(null) + (requireActivity() as MainActivity)?.openLime3DSDirectory?.launch(null) } } .show() diff --git a/src/android/app/src/main/java/io/github/lime3ds/android/fragments/SelectUserDirectoryDialogFragment.kt b/src/android/app/src/main/java/io/github/lime3ds/android/fragments/SelectUserDirectoryDialogFragment.kt index 97c343b7c..2ed0bfc4b 100644 --- a/src/android/app/src/main/java/io/github/lime3ds/android/fragments/SelectUserDirectoryDialogFragment.kt +++ b/src/android/app/src/main/java/io/github/lime3ds/android/fragments/SelectUserDirectoryDialogFragment.kt @@ -26,7 +26,7 @@ class SelectUserDirectoryDialogFragment : DialogFragment() { .setTitle(R.string.select_lime3ds_user_folder) .setMessage(R.string.cannot_skip_directory_description) .setPositiveButton(android.R.string.ok) { _: DialogInterface, _: Int -> - mainActivity.openLime3DSDirectory.launch(null) + mainActivity?.openLime3DSDirectory?.launch(null) } .show() } diff --git a/src/android/app/src/main/java/io/github/lime3ds/android/ui/main/MainActivity.kt b/src/android/app/src/main/java/io/github/lime3ds/android/ui/main/MainActivity.kt index 0698d42b4..b17614369 100644 --- a/src/android/app/src/main/java/io/github/lime3ds/android/ui/main/MainActivity.kt +++ b/src/android/app/src/main/java/io/github/lime3ds/android/ui/main/MainActivity.kt @@ -300,7 +300,7 @@ class MainActivity : AppCompatActivity(), ThemeProvider { windowInsets } - val openLime3DSDirectory = registerForActivityResult( + val openLime3DSDirectory = registerForActivityResult( ActivityResultContracts.OpenDocumentTree() ) { result: Uri? -> if (result == null) { @@ -337,4 +337,4 @@ class MainActivity : AppCompatActivity(), ThemeProvider { .build() ) } -} \ No newline at end of file +}