public static int getThemeAttributeDimensionSize ( Context context , int attr ) { TypedArray a = null ; try { a = context . getTheme ( ) . obtainStyledAttributes ( new int [ ] { attr } ) ; return a . getDimensionPixelSize ( 0 , 0 ) ; } finally { if ( a != null ) { a . recycle ( ) ; } } }
Returns the size in pixels of an attribute dimension