How to set systen UI to dark mode(not app) programmatically?

Viewed 594

I am trying to find a way to programmatically.

So far i am able to directly open the display settings menu by

startActivityForResult(new Intent(android.provider.Settings.ACTION_DISPLAY_SETTINGS), 0);

But i can't find a way of interacting with the buttons within that preferences menu?Anything to suggest?To be more clear i am interested in setting UI dark theme programatically through an app(not the application's theme but the device's whole UI).

1 Answers

I'm not entirely sure that is what you're looking for, but you can use the UiModeManager to change the system-wide mode from you app.

Related