I want to tint my tabhost\'s icons using XML, instead of doing it programmatically (I wasn\'t able to do that anyway)...
I found this thread on SO: Android imagevie
With current AppCompat support library, you can use app:tint on ImageView tag which will be inflated as AppCompatImageView and handle the state change properly.
In AppCompatImageView, you can see that mImageHelper is notified of the state change:
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
if (mBackgroundTintHelper != null) {
mBackgroundTintHelper.applySupportBackgroundTint();
}
if (mImageHelper != null) {
mImageHelper.applySupportImageTint();
}
}
Android Studio currently gives a warning on this, but you can safely suppress it.