How to determine if an Android app is using light mode or dark mode

To check if an Android app is using Dark Mode or Light Mode in Kotlin, use the function isSystemInDarkTheme().

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 06/12/2023 at 18:25
Last Updated on 06/12/2023 at 18:33
Two flowers that represent Kotlin and Android Studio side by side, beneath them sits the text "Dark Mode or Light Mode?"

To check if an Android app is using Dark Mode or Light Mode in Kotlin, use the function isSystemInDarkTheme().

SubscribeDownload Open Source Kotlin Starter Project
A screenshot of Android Studio showing the Theme.kt file. Highlighted is the updated theme code.

A sample use of isSystemInDarkTheme() can be found in the Theme.kt file within our Open Source Repository.

isSystemInDarkTheme()
How to use light mode and dark mode in Android Studio and Kotlin

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
SubscribeContact UsVisit our BlogView our ServicesView our Work

Partner with us

We would love to get to know you and see how we can help your organization with its goals and needs.
Let's Talk

Stay Informed

Get occasional updates about our company, research, and product launches.
Subscribe