title: How to detect down arrow on keypad
body: <p>how can I detect the down arrow on the keypad.</p>
  <p>I have an edit text, when it is clicked i open a number keypad, I want to detect when the keyboard is closed by clicking on the down arrow as shown in the pic.</p>
  <p>I tried <code>etCostLimit.setOnFocusChangeListener</code> this method is not triggered when down arrow is pressed on the keypad.</p>
  <p>I tried <code>onBackPressed()</code> but that got triggered only when I moved back to the previous activity.</p>
  <p>How can I know when the down arrow is clicked, what I want to do then is to hide the confirm and cancel buttons.</p>
  <pre><code>     &lt;EditText
                          android:id=&quot;@+id/etCostLimit&quot;
                          style=&quot;@style/EditText&quot;
                          android:layout_width=&quot;0dp&quot;
                          android:layout_height=&quot;wrap_content&quot;
                          android:layout_marginStart=&quot;8dp&quot;
                          android:gravity=&quot;center_horizontal&quot;
                          android:inputType=&quot;numberSigned|numberDecimal&quot;
                          android:digits=&quot;0123456789.,-&quot;
                          android:hint=&quot;@string/charge_restrictions_cost_placeholder&quot;
                          app:layout_constraintWidth_percent=&quot;0.30&quot;
                          app:layout_constraintStart_toEndOf=&quot;@+id/tvNeverChangeOver&quot;
                          app:layout_constraintTop_toBottomOf=&quot;@+id/dividerLineHorizontal&quot; /&gt;
  
  override fun onBackPressed(): Boolean {
      Log.d(&quot;PriceLimitFragment&quot;, &quot;onBackPressed&quot;)
      return super.onBackPressed()
  
  }
  
   etCostLimit.setOnFocusChangeListener { v, hasFocus -&gt;
          updateSaveBtnEnabledStatus(hasFocus)
      }
  </code></pre>
  <p>thanks in advance
  R</p>
  <p><a href="https://i.stack.imgur.com/XJSFA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XJSFA.png" alt="enter image description here" /></a></p>