I'm trying to change a key icon on press in run time:


@Override public void onPress(int primaryCode) { Keyboard currentKeyboard = 
KbView.getKeyboard(); List<Keyboard.Key> keys = currentKeyboard.getKeys(); 
KbView.invalidateKey(primaryCode); keys.get(primaryCode).label = null; 
keys.get(primaryCode).icon = R.drawable.image; }


However, the last line says:


Incompatible types. Required: android.graphics.drawable.Drawable Found: int


If I use instead: keys.get(ponto).icon = 
getResources().getDrawable(R.drawable.image); says that getDrawable(int) is 
deprecated. (It works, but when I press a key, change the icon of other key)

(I'm using API level 8)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to