private void setHeaderBackground ( int colorResId , int drawableResId ) { if ( drawableResId == - 1 ) { try { header . setBackgroundColor ( getResources ( ) . getColor ( colorResId ) ) ; } catch ( Resources . NotFoundException e ) { e . printStackTrace ( ) ; } } else { try { header . setBackgroundDrawable ( getResources ( ) . getDrawable ( drawableResId ) ) ; } catch ( Resources . NotFoundException e ) { e . printStackTrace ( ) ; } } }
Set the background color of the header