Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Other versions
Version 17.0Version 16.0 (current version)Version 15.0Version 14.0Version 13.0Version 12.0Version 11.0Version 10.0Version 2.0

Index

On this page

KMManager.createInputView()

Summary

The createInputView() creates the input view to be used in InputMethodService.

Syntax

KMManager.createInputView(InputMethodService inputMethodService)

Parameters

inputMethodService
The InputMethodService.

Returns

Returns the input view created.

Description

Use this method to create the input view in response to an InputMethodService's onCreateInputView() method.

Examples

Example: Using createInputView()

The following script illustrate the use of createInputView():

private static View inputView = null;

@Override
public View onCreateInputView() {
    // create the inputView only once
    if (inputView == null)
        inputView = KMManager.createInputView(this);
    
    // we must remove the inputView from its previous parent before returning it
    ViewGroup parent = (ViewGroup) inputView.getParent();
    if (parent != null)
        parent.removeView(inputView);
    
    return inputView;
}

See also