com.d4rk.androidtutorials.java
com.d4rk.androidtutorials.java copied to clipboard
Settings Changes Not Reflected in UI Without Manual Restart
Method: applySettings() in MainViewModel.java
Description:
When settings are changed through applySettings() method (theme, language, etc.), the UI does not immediately reflect these changes. User must manually restart the app to see the changes take effect.
Steps to Reproduce:
- Open app settings
- Change theme from light to dark (or vice versa)
- Return to main screen
- Notice UI still shows old theme
Expected Behavior: UI should immediately update to reflect new settings without requiring app restart.
Actual Behavior: Settings are saved but UI doesn't update until app is manually restarted.
Proposed Fix Emit an explicit UI update signal or trigger activity recreation after applying settings:
uiState.setValue(new MainUiState(visibilityMode, startFragmentId, changedTheme || true));