How to clear editText value in android studio using kotlin - Joklinz-Tech

Latest

Home Of Tech news,jobs and android tutorials

Monday 5 February 2018

How to clear editText value in android studio using kotlin

val btn=findViewById<View>(R.id.button2) as Button
val enter=findViewById<View>(R.id.editText) as EditText

btn.setOnClickListener {
    val ad=enter.text.toString().trim()
          enter.text=null       
}

No comments:

Post a Comment