-
-
Save codeforfun-jp/fcb6f2f86ccf544805d6156c33716f5b to your computer and use it in GitHub Desktop.
Dialog Full Screen
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 { | |
val dialog = activity?.let { | |
AlertDialog.Builder(it, R.style.DialogTheme) | |
.setTitle("タイトル") | |
.setMessage("ここにメッセージが入ります。ここにメッセージが入ります。") | |
.setPositiveButton("OK") { _, _ -> } | |
.create() | |
} | |
return dialog ?: throw IllegalStateException("アクティビティがNullです。") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment