Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created November 11, 2023 00:27
Show Gist options
  • Save codeforfun-jp/ac57419776c5d205eb5225ef7d0bdb8c to your computer and use it in GitHub Desktop.
Save codeforfun-jp/ac57419776c5d205eb5225ef7d0bdb8c to your computer and use it in GitHub Desktop.
How to create dialog series 1 basic - kotlin 3
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
findViewById<Button>(R.id.btn).setOnClickListener {
val dialogFragment = MyDialogFragment()
dialogFragment.show(supportFragmentManager, "my_dialog")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment