반응형
android.R.attr 참조를 이용하여
현재 theme의 리소스 정보 얻어오기..
TypedArray a = getTheme().obtainStyledAttributes(new int[] {
android.R.attr.windowBackground
});
Drawable backgroundDrawable = a.getDrawable(0);
a.recycle();
TypedArray a = getTheme().obtainStyledAttributes(new int[] {
android.R.attr.colorBackground,
android.R.attr.textColorPrimary,
});
int backgroundColor = a.getColor(0, 0);
int textColor = a.getColor(1, 0);
a.recycle();반응형
'지식쌓기 > 개발-Android' 카테고리의 다른 글
| Android - Google login / Google plus login 뭐가 다르냐!!! (1) | 2014.06.17 |
|---|---|
| Android - system resource 위치 (2) | 2014.06.17 |
| DialogFragment 이것저것 (0) | 2014.04.02 |
| android 이것 저것 (0) | 2014.02.07 |
| 원하는 theme로 widget 생성하기 (2) | 2013.07.04 |