We've got a user setting to choose light/dark/'sys...
# compose
s
We've got a user setting to choose light/dark/'system' theme, which updates the UI by providing different colors to
MaterialTheme
as needed. The only problem: the keyboard always matches the OS theme instead. Does anyone have any suggestions to fix this? I've seen mentions of
AppCompatDelegate.setDefaultNightMode
, but that seems to require my main activity to extend
AppCompatActivity
, for which the
setContent
extension function isn't available.
i
AppCompatActivity extends ComponentActivity (indirectly via FragmentActivity), so you can certainly use
setContent
there
s
D'oh my bad, thank you! I should have run the app. Android Studio highlights
setContent
in red with 'unresolved reference' on hover, but the build does in fact succeed.