Clicking the cancel button showInputDialogue

前端 未结 3 1495
花落未央
花落未央 2021-01-12 07:29

I have a question in regards to pressing the cancel button of my inputDialoguebox. I have asked a similar question before so I apologize if I seem to repeat myself.

<
3条回答
  •  梦谈多话
    2021-01-12 08:00

    I had this same issue, and I solved it as follow:

    if(input != null){
        if(!input.isEmpty()){
         // Do whatever...
        }
    }
    

    So, I basically moved the null test before testing if the user has entered some input. Hope this helped!

提交回复
热议问题