I have an EditText in my application. This editText is being updated through code for every 10 seconds using editText.setText method. I want to stop this updation when user opens soft keyboard. When user completes his typing action (Press done) button I want to resume updation from editText.setText. I have tried InputMethodManager isActive(View) to check whether my EditText is currently active while using editText.setText method. This perfectly works when keyboard is displayed. But when user clicks done button and soft-keyboard gets hidden, isActive(View) still gives true and my editText.setText is not being called. Below is my code which updates editText every 10 seconds.
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if(!imm.isActive(editText)){
editText.setText("10.2");
}
So this imm.isActive(editText) returns true even after user press done button of soft keyboard. Please suggest any way to get this done.