Created
November 5, 2022 21:20
-
-
Save k0siara/e71b661c50d7243d81a7c010e2f6e677 to your computer and use it in GitHub Desktop.
MyDialogFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyDialogFragment : DialogFragment() { | |
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | |
AlertDialog.Builder(requireContext()) | |
.setMessage(getString(R.string.order_confirmation)) | |
.setPositiveButton(getString(R.string.ok)) { _, _ -> | |
findNavController() | |
.previousBackStackEntry | |
?.savedStateHandle?.set("my-result-key", "example-data") | |
} | |
.create() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment