title: Android/Kotlin - adding TextInputLayout.END_ICON_CLEAR_TEXT to textview doesn't perform the setOnFocusChangeListener
body: <p>i've a problem in android app written in <em>Kotlin</em>.</p>
  <p>I've a textview that has a <em>setOnFocusChangeListener</em> and it worked fine as long as i've added an <strong>EndIconMode</strong>.
  Now in my layout i see the <em>END_ICON_CLEAR_TEXT</em> and this works, <strong>but nothing happens when this textview loses focus</strong>.</p>
  <p>How can I made this works?</p>
  <pre><code>textInputLayout = LayoutInflater.from(activity).inflate(R.layout.textinputlayouttemplate, null) as TextInputLayout
  val textView = CreateUI._TextView(castToField(field), textInputLayout.context)
  
  if (field.validatefield || field.nextpage != 0)
  {
      textView.setOnFocusChangeListener { _, hasFocus -&gt;
          if (!hasFocus &amp;&amp; !GlobalVar.drawerOpened)
          {
              if ((field.mandatory &amp;&amp; !textView.text.toString().isNullOrEmpty()) || (!field.mandatory)) {
                  if (field.validatefield) {
                      validateField(field.fieldcode, textView.text.toString(), field.nextpage)
                  } else {
                      _goToNextPageNo = field.nextpage
                      goToNextPageIfExist()
                  }
              }
          }
      }
  }
  
  textInputLayout.addView(textView, layout_wMATCHPARENT_hWRAPCONTENT)
  textInputLayout.layoutParams = layout_wMATCHPARENT_hWRAPCONTENT
  textInputLayout.setPadding(0, 0, 0, 0)
  textInputLayout.endIconMode = TextInputLayout.END_ICON_CLEAR_TEXT
  linearLayout.addView(textInputLayout)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/SNPRv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SNPRv.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/NQGuU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NQGuU.png" alt="enter image description here" /></a></p>