FileDocCategorySizeDatePackage
AbstractInputMethodService.javaAPI DocAndroid 5.1 API8516Thu Mar 12 22:22:10 GMT 2015android.inputmethodservice

AbstractInputMethodService

public abstract class AbstractInputMethodService extends android.app.Service implements KeyEvent.Callback
AbstractInputMethodService provides a abstract base class for input methods. Normal input method implementations will not derive from this directly, instead building on top of {@link InputMethodService} or another more complete base class. Be sure to read {@link InputMethod} for more information on the basics of writing input methods.

This class combines a Service (representing the input method component to the system with the InputMethod interface that input methods must implement. This base class takes care of reporting your InputMethod from the service when clients bind to it, but provides no standard implementation of the InputMethod interface itself. Derived classes must implement that interface.

Fields Summary
private android.view.inputmethod.InputMethod
mInputMethod
final KeyEvent.DispatcherState
mDispatcherState
Constructors Summary
Methods Summary
protected voiddump(java.io.FileDescriptor fd, java.io.PrintWriter fout, java.lang.String[] args)
Implement this to handle {@link android.os.Binder#dump Binder.dump()} calls on your input method.

    
public KeyEvent.DispatcherStategetKeyDispatcherState()
Return the global {@link KeyEvent.DispatcherState KeyEvent.DispatcherState} for used for processing events from the target application. Normally you will not need to use this directly, but just use the standard high-level event callbacks like {@link #onKeyDown}.

        return mDispatcherState;
    
public final android.os.IBinderonBind(android.content.Intent intent)

        if (mInputMethod == null) {
            mInputMethod = onCreateInputMethodInterface();
        }
        return new IInputMethodWrapper(this, mInputMethod);
    
public abstract android.inputmethodservice.AbstractInputMethodService$AbstractInputMethodImplonCreateInputMethodInterface()
Called by the framework during initialization, when the InputMethod interface for this service needs to be created.

public abstract android.inputmethodservice.AbstractInputMethodService$AbstractInputMethodSessionImplonCreateInputMethodSessionInterface()
Called by the framework when a new InputMethodSession interface is needed for a new client of the input method.

public booleanonGenericMotionEvent(android.view.MotionEvent event)
Implement this to handle generic motion events on your input method.

param
event The motion event being received.
return
True if the event was handled in this function, false otherwise.
see
View#onGenericMotionEvent

        return false;
    
public booleanonTrackballEvent(android.view.MotionEvent event)
Implement this to handle trackball events on your input method.

param
event The motion event being received.
return
True if the event was handled in this function, false otherwise.
see
View#onTrackballEvent

        return false;