com.d4rk.androidtutorials.java icon indicating copy to clipboard operation
com.d4rk.androidtutorials.java copied to clipboard

Settings Changes Not Reflected in UI Without Manual Restart

Open Mehrad25Software opened this issue 3 months ago • 0 comments

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:

  1. Open app settings
  2. Change theme from light to dark (or vice versa)
  3. Return to main screen
  4. 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));

Mehrad25Software avatar Nov 11 '25 03:11 Mehrad25Software