From 7f934c820971c70f6af7d8929cd633e8dd58904a Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Thu, 15 Aug 2024 18:02:30 -0300 Subject: [PATCH] Fix back navigation when FirstRunFragment is shown --- .../com/stevesoltys/seedvault/settings/FirstRunFragment.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/stevesoltys/seedvault/settings/FirstRunFragment.kt b/app/src/main/java/com/stevesoltys/seedvault/settings/FirstRunFragment.kt index 78090dd6..ce3a3483 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/settings/FirstRunFragment.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/settings/FirstRunFragment.kt @@ -6,6 +6,7 @@ package com.stevesoltys.seedvault.settings import android.app.Dialog +import android.content.DialogInterface import android.content.Intent import android.os.Bundle import androidx.fragment.app.DialogFragment @@ -16,7 +17,6 @@ import com.stevesoltys.seedvault.restore.RestoreActivity class FirstRunFragment : DialogFragment() { override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { - isCancelable = false // is what really works, specifying it for the dialog only doesn't return MaterialAlertDialogBuilder(requireContext()) .setMessage(R.string.first_start_text) .setPositiveButton(R.string.setup_button) { dialog, _ -> @@ -31,7 +31,10 @@ class FirstRunFragment : DialogFragment() { dialog.dismiss() requireActivity().finish() } - .setCancelable(false) .create() } + + override fun onCancel(dialog: DialogInterface) { + requireActivity().finish() + } }