summaryrefslogtreecommitdiffstats
path: root/src/android/app
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-06-02 20:23:25 +0200
committerbunnei <bunneidev@gmail.com>2023-06-03 09:06:08 +0200
commita789046127dba7b5d4c7510d730f1241c731a94a (patch)
tree6e8f47fd1c3e7cb3660d69cd767943cdfd6b351c /src/android/app
parentandroid: vk_presentation_manager: Fix unusued needs_recreation. (diff)
downloadyuzu-a789046127dba7b5d4c7510d730f1241c731a94a.tar
yuzu-a789046127dba7b5d4c7510d730f1241c731a94a.tar.gz
yuzu-a789046127dba7b5d4c7510d730f1241c731a94a.tar.bz2
yuzu-a789046127dba7b5d4c7510d730f1241c731a94a.tar.lz
yuzu-a789046127dba7b5d4c7510d730f1241c731a94a.tar.xz
yuzu-a789046127dba7b5d4c7510d730f1241c731a94a.tar.zst
yuzu-a789046127dba7b5d4c7510d730f1241c731a94a.zip
Diffstat (limited to 'src/android/app')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt
index 7a990d0cc..5f107b37d 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt
@@ -11,6 +11,7 @@ import android.provider.DocumentsContract
import android.widget.Toast
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
+import androidx.appcompat.app.AppCompatActivity
import androidx.documentfile.provider.DocumentFile
import androidx.fragment.app.DialogFragment
import com.google.android.material.dialog.MaterialAlertDialogBuilder
@@ -49,6 +50,7 @@ class ImportExportSavesFragment : DialogFragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
+ val activity = requireActivity() as AppCompatActivity
val activityResultRegistry = requireActivity().activityResultRegistry
startForResultExportSave = activityResultRegistry.register(
@@ -61,7 +63,7 @@ class ImportExportSavesFragment : DialogFragment() {
"documentPickerKey",
ActivityResultContracts.OpenDocument()
) {
- it?.let { uri -> importSave(uri) }
+ it?.let { uri -> importSave(uri, activity) }
}
}
@@ -183,7 +185,7 @@ class ImportExportSavesFragment : DialogFragment() {
* Imports the save files contained in the zip file, and replaces any existing ones with the new save file.
* @param zipUri The Uri of the zip file containing the save file(s) to import.
*/
- private fun importSave(zipUri: Uri) {
+ private fun importSave(zipUri: Uri, activity: AppCompatActivity) {
val inputZip = context.contentResolver.openInputStream(zipUri)
// A zip needs to have at least one subfolder named after a TitleId in order to be considered valid.
var validZip = false
@@ -214,7 +216,7 @@ class ImportExportSavesFragment : DialogFragment() {
MessageDialogFragment.newInstance(
R.string.save_file_invalid_zip_structure,
R.string.save_file_invalid_zip_structure_description
- ).show(childFragmentManager, MessageDialogFragment.TAG)
+ ).show(activity.supportFragmentManager, MessageDialogFragment.TAG)
return@withContext
}
Toast.makeText(