I am Working on a Custom Keyboard and I need to set different image for each key at runtime or dynamically but I am not getting how to do this.
I am using this code:
<com.keyboard.KeyBoard.LatinKeyboardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res/com.keyboard.KeyBoard"
android:id="@+id/keyboard"
android:keyBackground="@drawable/black_bg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:focusable="true"
android:background="@android:color/black"
android:focusableInTouchMode="true" />
and now i want to get android:keyBackground="@drawable/black_bg"
attribute in:
@Override
public void onStartInputView(EditorInfo attribute, boolean restarting) {
super.onStartInputView(attribute, restarting);
}
because i have to change image background here for keys dynamically but I am not getting how to do this.