private void obtainHeaderBackground ( @ StyleRes final int themeResourceId ) { TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogHeaderBackground } ) ; int resourceId = typedArray . getResourceId ( 0 , 0 ) ; if ( resourceId != 0 ) { setHeaderBackground ( resourceId ) ; } else { setHeaderBackgroundColor ( ThemeUtil . getColor ( getContext ( ) , themeResourceId , R . attr . colorPrimary ) ) ; } }
Obtains the background of the dialog s header from a specific theme .