Fix back navigation when FirstRunFragment is shown
This commit is contained in:
parent
22b3ace3aa
commit
7f934c8209
1 changed files with 5 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue