public class InputMethodService.InputMethodImpl extends AbstractInputMethodService.AbstractInputMethodImpl
AbstractInputMethodService.AbstractInputMethodImpl
that provides
all of the standard behavior for an input method.InputMethod.SessionCallback
SERVICE_INTERFACE, SERVICE_META_DATA, SHOW_EXPLICIT, SHOW_FORCED
Constructor and Description |
---|
InputMethodImpl() |
Modifier and Type | Method and Description |
---|---|
void |
attachToken(IBinder token)
Take care of attaching the given window token provided by the system.
|
void |
bindInput(InputBinding binding)
Handle a new input binding, calling
InputMethodService.onBindInput()
when done. |
void |
changeInputMethodSubtype(InputMethodSubtype subtype)
Notify that the input method subtype is being changed in the same input method.
|
void |
hideSoftInput(int flags,
ResultReceiver resultReceiver)
Handle a request by the system to hide the soft input area.
|
void |
restartInput(InputConnection ic,
EditorInfo attribute)
This method is called when the state of this input method needs to be
reset.
|
void |
showSoftInput(int flags,
ResultReceiver resultReceiver)
Handle a request by the system to show the soft input area.
|
void |
startInput(InputConnection ic,
EditorInfo attribute)
This method is called when the application starts to receive text and it
is ready for this input method to process received events and send result
text back to the application.
|
void |
unbindInput()
Clear the current input binding.
|
createSession, revokeSession, setSessionEnabled
public void attachToken(IBinder token)
public void bindInput(InputBinding binding)
InputMethodService.onBindInput()
when done.binding
- Information about the application window that is binding
to the input method.InputBinding
,
InputMethod.unbindInput()
public void unbindInput()
public void startInput(InputConnection ic, EditorInfo attribute)
InputMethod
ic
- Optional specific input connection for
communicating with the text box; if null, you should use the generic
bound input connection.attribute
- Information about the text box (typically, an EditText)
that requests input.EditorInfo
public void restartInput(InputConnection ic, EditorInfo attribute)
InputMethod
Typically, this method is called when the input focus is moved from one text box to another.
ic
- Optional specific input connection for
communicating with the text box; if null, you should use the generic
bound input connection.attribute
- The attribute of the text box (typically, a EditText)
that requests input.EditorInfo
public void hideSoftInput(int flags, ResultReceiver resultReceiver)
flags
- Provides additional information about the show request.
Currently always 0.resultReceiver
- The client requesting the show may wish to
be told the impact of their request, which should be supplied here.
The result code should be
InputMethodManager.RESULT_UNCHANGED_SHOWN
,
InputMethodManager.RESULT_UNCHANGED_HIDDEN
,
InputMethodManager.RESULT_SHOWN
, or
InputMethodManager.RESULT_HIDDEN
.public void showSoftInput(int flags, ResultReceiver resultReceiver)
flags
- Provides additional information about the show request.
Currently may be 0 or have the bit InputMethod.SHOW_EXPLICIT
set.resultReceiver
- The client requesting the show may wish to
be told the impact of their request, which should be supplied here.
The result code should be
InputMethodManager.RESULT_UNCHANGED_SHOWN
,
InputMethodManager.RESULT_UNCHANGED_HIDDEN
,
InputMethodManager.RESULT_SHOWN
, or
InputMethodManager.RESULT_HIDDEN
.public void changeInputMethodSubtype(InputMethodSubtype subtype)
InputMethod
subtype
- New subtype of the notified input method