Change text color from InputMethodService

I'm modifying gingerbread keyboard. I want to change the color of the text that i'm entering. Its possible when I'm entering the text using InputConnection.setComposingText(CharSequence, cursorPosition) since the argument of the method setComposingText allows a Spannable type. But when I press the space button, that is, when the text is committed, the color goes back to default.

InputConnection's commitText method takes the same arguments as the setComposingText. But the color is not changed. How can I overcome the problem?

will appreciate any help

Answers


public abstract boolean commitText (CharSequence text, int newCursorPosition)
Commit text to the text box and set the new cursor position. Any composing text set previously will be removed automatically.

commitText function sends only the raw text to a TextBox removing any special composing styling or other state that was around it. Because it is up to the application what it should do with the text and not the responsibility of an Input Method. What style a text can support depends totally on the respective app.


Need Your Help

How to access a parameter in jrxml file and Print it?

java jasper-reports

My query is, I have set a parameter in my java file like given below

How to cache downloaded images

c# windows-phone-7

I am using below code direct bind all the data into the list including images