Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要知道用户是否在操作系统级别启用了深色主题,以便我可以在我的应用程序中自动启用深色主题。(不强制使用深色模式)
检测系统是否处于深色主题中。有帮助。
switch (getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) { case Configuration.UI_MODE_NIGHT_YES: //process break; case Configuration.UI_MODE_NIGHT_NO: // process break; }