public static StateListDrawable getIconStateList ( Drawable icon , Drawable selectedIcon ) { StateListDrawable iconStateListDrawable = new StateListDrawable ( ) ; iconStateListDrawable . addState ( new int [ ] { android . R . attr . state_selected } , selectedIcon ) ; iconStateListDrawable . addState ( new int [ ] { } , icon ) ; return iconStateListDrawable ; }
helper to create a stateListDrawable for the icon