I have a custom keyboard in my application. question is How to didplay this keyboard when click on the edittext.I an using setonfocuschangre listener ,now the custon keyboa
Initiate the InputConnection of your edit text and create methods to delete and enter texts when your custom keyboard view is performed with any user actions.
Declare inputConnection on the activity onCreate method as below;
InputConnection inputConnection = editText.onCreateInputConnection(new EditorInfo());
When you enter any text execute the below code.
inputConnection.commitText(text, 1);
When you click the clear / backspace button execute the below code.
if (TextUtils.isEmpty(inputConnection.getSelectedText(0))) {
inputConnection.deleteSurroundingText(1, 0);
} else {
inputConnection.commitText("", 1);
}