2010-09-07 14 views

risposta

34
TypedArray array = getTheme().obtainStyledAttributes(new int[] { 
    android.R.attr.colorBackground, 
    android.R.attr.textColorPrimary, 
}); 
int backgroundColor = array.getColor(0, 0xFF00FF); 
int textColor = array.getColor(1, 0xFF00FF); 
array.recycle(); 
+0

Grazie mille. – arcs

0

Per Sfondo

TypedArray array = context.getTheme().obtainStyledAttributes(new int[] { 
     android.R.attr.windowBackground}); 
    int backgroundColor = array.getColor(0, 0xFF00FF); 
    array.recycle(); 
    view.setBackgroundColor(backgroundColor); 
Problemi correlati