I have multiple background colors of the keyboard in my app user can select any color for the keyboard background. The problem I am getting is when the user selects any color to apply on the keyboard it's working but the candidate views not change the color its color is the same as the first theme. When I rotate the app screen the candidate view color is also changed. Can you help me please change the candidate view color on runtime?
Asked
Active
Viewed 179 times
1 Answers
1
mCandidateView.setBackgroundResource( R.color.colorBlack);
@Override public void onStartInputView(EditorInfo attribute, boolean restarting) { super.onStartInputView(attribute, restarting);
if (modeReceived == MyConstants.Companion.getTHEME_KEYBOARD_MODE_DRAWABLE()) {
try {
int drawablePrefs =
sharedPreferences.getInt(MyConstants.Companion.getTHEME_KEYBOARD_DRAWABLE(), R.color.colorBlack);
if (mInputView != null) {
mInputView.setBackgroundResource(drawablePrefs);
mCandidateView.setBackgroundResource(drawablePrefs);
}

Dharman
- 30,962
- 25
- 85
- 135

Umer Shahzad
- 54
- 1
-
I also implement this but on create candidate method does not work – Muhammad Asad Mar 17 '21 at 08:24
-
can you show me your oncreatecandidateview() method code... – Umer Shahzad Mar 17 '21 at 10:48