当我试着打电话的时候 dismiss()
在我的messageboxbuilder上,但我 Unresolved reference: dismiss
,我尝试在messageboxview上调用它并更改它 setCancelable()
至 true
但同样的事情发生了。
fun create_Alert_Dialog(){
//Alert dialog builder
val messageBoxView = LayoutInflater.from(this).inflate(R.layout.layout_dialog,null)
//Alert dialog builder
val messageBoxBuilder = AlertDialog.Builder(this).setView(messageBoxView)
//Setting undissmissable
messageBoxBuilder.setCancelable(false)
//Show
messageBoxBuilder.create().show()
bt4 = messageBoxView.findViewById(R.id.bt4)
bt4.setOnClickListener {
Lose()
messageBoxBuilder.dismiss()
}
}
1条答案
按热度按时间l0oc07j21#
试着像这样重写你的代码