Show Error on the tip of the Edit Text Android

前端 未结 12 2101
一生所求
一生所求 2020-12-01 04:30

I want to show error if the user enters blank value in the edittext.But i am not getting the way how could i do this .This is how i want like this:

12条回答
  •  渐次进展
    2020-12-01 05:05

    Using Kotlin Language,

    EXAMPLE CODE

     login_ID.setOnClickListener {
                if(email_address_Id.text.isEmpty()){
                    email_address_Id.error = "Please Enter Email Address"
                }
                if(Password_ID.text.isEmpty()){
                    Password_ID.error = "Please Enter Password"
                }
            }
    

提交回复
热议问题