disable button for multiple click : I have a button that when click shows a dialog. But when you click the button quickly in multiple times, it will 

> show 2 or more dialog on the screen

 depends on how many times you click the button before dialog shows. So I have to close each dialog many times...

I already used ***dialog.isShowing*** but it seems that it will ignore it when you 

> click the button quickly in multiple times

...So I want to click button at a time when dialog is closed.

    private var mFlag = false
    
        fun myButton(view : View) {
            var tempDialog = AlertDialog.Builder(this).create()
            
            if (!mFlag) {
                myDialog.show()
                mFlag = true
            }

            if(dialog.isShowing){
               mFlag = false
            }
        }