I am trying to understand and resolve and error I am seeing in the Eclipse workspace log while working on an Android app that implements an IME. I am new to Android and Ecli
I found solution.
Use KeyboardViewFix as replace KeyboardView:
public class KeyboardViewFix extends KeyboardView {
public static boolean inEditMode = true;
@TargetApi(21) // Build.VERSION_CODES.L
public KeyboardViewFix(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(inEditMode ? new ContextWrapperInner(context) : context, attrs, defStyleAttr, defStyleRes);
}
public KeyboardViewFix(Context context, AttributeSet attrs, int defStyleAttr) {
super(inEditMode ? new ContextWrapperInner(context) : context, attrs, defStyleAttr);
}
public KeyboardViewFix(Context context, AttributeSet attrs) {
super(inEditMode ? new ContextWrapperInner(context) : context, attrs);
}
public static class ContextWrapperInner extends ContextWrapper {
Context base;
public ContextWrapperInner(Context base) {
super(base);
this.base = base;
}
public Object getSystemService(String name) {
return Context.AUDIO_SERVICE.equals(name) ? null : base.getSystemService(name);
}
}
}
One note: On start your app, before any other code you need set KeyboardViewFix.inEditMode = false; or you can get some errors.