Mrjsaw / ChessClock

Apache License 2.0
1 stars 1 forks source link

Timers reset on first time the dark mode is activated... #21

Open H3AR7B3A7 opened 3 years ago

H3AR7B3A7 commented 3 years ago

To recreate issue:

  1. start klok
  2. change theme
  3. return to main en start again

compare with: going through steps 1 through 3 again ...

enkel eerste keer resetten de timers

Mrjsaw commented 3 years ago

Does changing the theme the first time recreate the SettingsActivity or MainActivity? recreating SettingsActivity sets the sharedPrefs to the last entered values (if none are given it takes the default values) recreating MainActivity sets the timers to the sharedPrefs values (TOP_TIME, BOT_TIME)

H3AR7B3A7 commented 3 years ago

Ja, SettingsActivity, maar dat doet hij iedere keer als ge op die knop duwt ... niet enkel eerste keer. Dan killt hij activity met: this.activity?.recreate() Ik denk niet dat het daar aan ligt.

Maar als ik in MainActivity 'loadData()' uitcomment dan gebeurt het nimeer...

Misschien moeten de prefs van de clock in een andere instantie van SharedPreferences worden bijgehouden en niet worden meegegeven aan onResume? Maar ik dacht dat die enkele dagen geleden nog niet in de sharedPreferences zaten? Ofwel?