Android AlertDialog Single Button

后端 未结 9 1693
陌清茗
陌清茗 2020-12-12 12:08

I\'d like to have an AlertDialog builder that only has one button that says OK or Done or something, instead of the default yes and no. Can that be done with the standard Al

9条回答
  •  天命终不由人
    2020-12-12 12:27

    Kotlin?

      val dialogBuilder = AlertDialog.Builder(this.context)
      dialogBuilder.setTitle("Alert")
                   .setMessage(message)
                   .setPositiveButton("OK", null)
                   .create()
                   .show()
    

提交回复
热议问题