Android Style vs. Theme and Attribute Resolution

Tests your grasp of Android's resource scope and resolution timing. A Style targets a single View, while a Theme applies to a whole Context. `@color/` is a direct, compile-time link; `?attr/` is an indirect pointer resolved against the Theme at runtime.
This tests your grasp of Android resource scope and resolution timing, key for maintainable UIs. A Style is a set of attributes for one View; a Theme is a style applied to a Context (e.g., Activity), affecting all its Views. `@color/` is a direct, compile-time reference to a specific value. `?attr/` is an indirect pointer resolved at runtime against the current Theme, enabling features like dark mode. A major red flag is stating that `?attr/` is resolved at compile time, which fundamentally misunderstands theming.
Read the original → developer.android.com
- #android
- #ui
- #resources
- #theming
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.