This question already has an answer, it's a contibution to SO question base.
In my custom view I implemented the onCreateInputConnection
method like so:
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
BaseInputConnection baseInputConnection =
new BaseInputConnection(this, false);
outAttrs.actionLabel = null;
outAttrs.inputType = InputType.TYPE_NULL;
outAttrs.imeOptions = EditorInfo.IME_ACTION_NONE;
return baseInputConnection;
}
But for some strange reason, in default AOSP keyboard in Android 5 only top row of keys work. Note that I have a landscape layout. If I switch to portrait, it starts to work properly. Other keyboards also work right.