Check if EditText is empty kotlin android

前端 未结 9 1927
悲哀的现实
悲哀的现实 2020-12-20 12:42

How do you check if an EditText is empty? input type number

\"\"

package com.example.www.myappl         


        
9条回答
  •  渐次进展
    2020-12-20 13:12

    Hey I am using like this in kotlin

     val input = editText?.text.toString().trim()
        if (input.isNullOrBlank()) {
           //Your code for blank edittext
        }
    

    Hope this will help you..let me know if any issue....

提交回复
热议问题