Example usage for android.view.inputmethod InputConnection GET_TEXT_WITH_STYLES

List of usage examples for android.view.inputmethod InputConnection GET_TEXT_WITH_STYLES

Introduction

In this page you can find the example usage for android.view.inputmethod InputConnection GET_TEXT_WITH_STYLES.

Prototype

int GET_TEXT_WITH_STYLES

To view the source code for android.view.inputmethod InputConnection GET_TEXT_WITH_STYLES.

Click Source Link

Document

Flag for use with #getTextAfterCursor and #getTextBeforeCursor to have style information returned along with the text.

Usage

From source file:com.strathclyde.highlightingkeyboard.SoftKeyboardService.java

/**
 * handle keyboard orientation being changed
 *///w  w w . j ava2  s .c  om
@Override
public void onConfigurationChanged(Configuration newConfig) {
    /*
    Log.i("Configuration Changed", "Now in mode: "+newConfig.orientation);
    Log.i("Configuration Changed", "FullScreen mode: "+isFullscreenMode());
    Log.i("Configuration Changed", "ExtractView shown: "+isExtractViewShown());
    */
    //get what's input so far
    try {
        ExtractedTextRequest req = new ExtractedTextRequest();
        req.token = 0;
        req.flags = InputConnection.GET_TEXT_WITH_STYLES;
        extractedText = ic.getExtractedText(req, 0);
    } catch (Exception e) {
        e.printStackTrace();
    }
    super.onConfigurationChanged(newConfig);

}