tôi đã cố gắng một cái gì đó như thế này, nhưng tôi bị mắc kẹt:làm thế nào để có được màu nền từ chủ đề hiện tại lập trình
TypedValue typedValue = new TypedValue();
if (this.parentActivity.getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true))
{
// how to get color?
}
tại xml android: background = "android:? Attr/colorBackground" – ademar111190
Tôi đã thử nghiệm và xác định rằng 'android:? Attr/colorBackground' tương ứng với' mục styles.xml' '- @ color/yourColorHere
'. –
@ ademar111190 đây phải là câu trả lời !!!! – Alexandr