public static void setBackgroundDrawable ( View view , Drawable drawable ) { if ( android . os . Build . VERSION . SDK_INT < android . os . Build . VERSION_CODES . JELLY_BEAN ) { view . setBackgroundDrawable ( drawable ) ; } else { view . setBackground ( drawable ) ; } }
Set a Background Drawable using the appropriate Android version api call