8000 registerOnSharedPreferenceChangeListener behavior · Issue #14 · Sloy/preferator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

registerOnSharedPreferenceChangeListener behavior #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tanwarsatya opened this issue Mar 31, 2018 · 1 comment
Open

registerOnSharedPreferenceChangeListener behavior #14

tanwarsatya opened this issue Mar 31, 2018 · 1 comment

Comments

@tanwarsatya
Copy link

Hi Sloy,

Thanks for the amazing work you did, it has reduced a good amount of time in development of our settings module.
We are noticing an issue when we have registered a listener to added SharedPreferences. The listener is working fine, but in certain cases where we are updating a string or int it's raising the callback on each key press. The normal behavior we were expecting was to receive a callback once uses completes the editing one field and moves out of the textview.

Any idea what might be happening here, i haven't looked into the code yet. Again thx a lot for great piece of work.

@Sloy
Copy link
Owner
Sloy commented Mar 31, 2018

Hi @tanwarsatya, I'm glad it's helping you :)

The behaviour you're seeing is consistent with how things are working internally. The preferences are saved on each key press.
It was done that way to simplify things, but maybe it would work just as fine with other callback in the EditText, like focus change or something like that.
Would you like to try that out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0