totzi10
totzi10

Reputation: 135

How to restart onCreateInputView()?

I have a keyboard with a onCreateInputView() method, I have to edit the keyboard dinamically and I have to restard the onCreateInputView() when particular preferences changes

Upvotes: 2

Views: 2138

Answers (2)

Sergey Sychevskiy
Sergey Sychevskiy

Reputation: 93

From https://developer.android.com/reference/android/inputmethodservice/InputMethodService.html#onCreateInputView():

Create and return the view hierarchy used for the input area (such as a soft keyboard). This will be called once, when the input area is first displayed. You can return null to have no input area; the default implementation returns null.

To control when the input view is displayed, implement onEvaluateInputViewShown(). To change the input view after the first one is created by this function, use setInputView(View).

Upvotes: 1

Myat Min Soe
Myat Min Soe

Reputation: 807

Add this line in onStartInputView method.

setInputView(onCreateInputView());

Upvotes: 9

Related Questions