region:us
int uiMode = getResources().getConfiguration().uiMode;
switch (uiMode & Configuration.UI_MODE_NIGHT_MASK) {
    case Configuration.UI_MODE_NIGHT_YES:
        // Night mode is active
        break;
    case Configuration.UI_MODE_NIGHT_NO:
        // Night mode is not active, day mode
        break;
    case Configuration.UI_MODE_NIGHT_UNDEFINED:
        // Night mode state is undefined
        break;
}
```

This code snippet checks whether the current UI mode is in night mode or day mode. You can then perform actions accordingly within each case block.