Tell me, how can you programmatically perform that when typing the maximum number of characters of the specified maxLenght in EditText, the keyboard is automatically removed? thank
EditText xKNPEditText = (EditText) findViewById(R.id.xKNP); avtoOffKeyPress(xKNPEditText); ...... public void avtoOffKeyPress(final EditText mEditText) { mEditText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { Log.i("MyApp", "Длина= "+mEditText.getText().toString().length()); if(mEditText.getText().toString().length() == 5){ InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(mEditText.getWindowToken(), 0); } } @Override public void afterTextChanged(Editable editable) { } }); } Why doesn't it refer to the method ????