//重写EditText,重写这个方法
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs){
super.onCreateInputConnection(outAttrs);//不加这一句的话,调出的输入法会被重置
}
/**
* 截获输入法文字
*/
public class TBLXInputConnection extends BaseInputConnection
{
public TBLXInputConnection(View targetView, boolean fullEditor)
{
super(targetView, fullEditor);
}
@Override
public boolean commitText(CharSequence text, int newCursorPosition)
{
text = text.toString();
// refresh(text);
return true;
}
@Override
public boolean deleteSurroundingText(int beforeLength, int afterLength)
{
return super.deleteSurroundingText(beforeLength, afterLength);
}
}