Tuesday, 1 October 2013

Warnings when closing SoftKeyboard manually

Warnings when closing SoftKeyboard manually

I'm using following code to close the EditText's SoftKeyboard when
clicking a button:
public void closeSoftInput(){
final Context c = this.getContext();
if(c==null)
return;
editText.clearFocus();
InputMethodManager imm = (InputMethodManager)c.getSystemService(
Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editText.getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
}
That works fine, but everytime I call closeSoftInput() I get these warnings:
10-01 21:55:13.075: W/IInputConnectionWrapper(25021): getSelectedText on
inactive InputConnection
10-01 21:55:13.075: W/IInputConnectionWrapper(25021): setComposingText on
inactive InputConnection
10-01 21:55:13.075: W/IInputConnectionWrapper(25021): getExtractedText on
inactive InputConnection
If I close the keyboard by pressing the back-key no warnings a thrown. Why
are they thrown when I execute closeSoftInput()?
Thx

No comments:

Post a Comment