title: Reliable way to know when android soft keyboard resigns (callback that works on every phone)
body: <p>We are working on our first android app and it has been a very enjoyable experience so far. It is almost complete, but before release we are having some considerations ,mainly about android soft keyboard.</p>
  
  <p>We have a couple of  <strong>EditText</strong> fields that are used to enter numbers. We would like to capture the event when user presses enter, and do some calcuations and saving on this callback.</p>
  
  <p>The problem is that we are not getting a fixed event as different phones have different keyboards. Some have 'Done' button and our HTC phones have 'Enter' buttons. We tried using the imeOptions as 'done' but that had no effect on the HTC phones. </p>
  
  <p>We also know that the keyboard can be <strong>dismissed by hitting the back button</strong>. So my question is if there is a reliable way to know when the user has stopped entering or when the keyboard is hidden, <strong>just like textFieldShouldReturn callback in iphone sdk</strong>(which will always fire when keyboard goes down, independent of what key caused it to go down)..</p>
  
  <p>In other words, <strong>how an android developer handles soft keyboard?</strong> I check for <strong>KeyEvent.KEYCODE_ENTER</strong> on editText <strong>onClick()</strong> event and do my tasks there.It is working on my HTC android, but not on my friends Nexus phone, which has a done button instead of enter. There onClick is not even called. How a developer handles this?</p>
  
  <p><em><strong>EDIT: After losing half of my hair, and with the help of some good friends here</em></strong> </p>
  
  <p>I have tried all your suggestions but at the end by <strong>using onEditorActionListener along with onKeyListener</strong> method did the trick for me. In <strong>onEdit callback of onEditorActionListener I checked for KeyCode ACTION_DONE</strong>, which did get called on keyboards with done button. <strong>On keyboards which has enter onKey gets called. In onKey method I checked for KEYCODE_BACK also</strong>, so that hardware back press event also can be handled. I haven't yet found out a android device with done and enter on the keyboard (seriously), still I even handled that case with a flag. Thanks @Femi for suggesting onEditorActionListener, and thanks for all friends for your help. But the answer to my original question</p>
  
  <p><strong>Q:</strong> Is there an reliable and easier way to know android soft keyboard resigns (callback that works on every phone) </p>
  
  <p><strong>Ans :</strong> No, All methods suggested here and all methods suggested on other sites are not straightforward. And I think handling an event for keyboard return key is the most basic thing for any operating system. <strong>Google, are you there?</strong> </p>