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
Asked
Active
Viewed 1,985 times
2
-
and what did you do, and your problem with that is...? – pskink Nov 29 '13 at 15:27
-
I have a value on sharedpreferences and if is true, I need to inflate layout1, if is false layout2. If I am on layout1 to change into layout2 I have to stop layout1, and call onCreateInputView(): how can I stop and recall that? – totzi10 Nov 29 '13 at 17:08
-
did you read this http://developer.android.com/reference/android/inputmethodservice/InputMethodService.html#onCreateInputView() ? – pskink Nov 29 '13 at 17:20
-
no... I have to set setInputView(View), right? – totzi10 Nov 29 '13 at 17:37
2 Answers
8
Add this line in onStartInputView method.
setInputView(onCreateInputView());

Myat Min Soe
- 787
- 8
- 32
1
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).

Vadim Kotov
- 8,084
- 8
- 48
- 62

Sergey Sychevskiy
- 93
- 1
- 6