You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Is there a reason why the preference fields for shared preferences do not share a common interface that exposes the get and put methods? They all extend AbstractPrefField and all implement a get and put method, but it is not enforced.
However, (to clarify why I ask this question) I am trying to create a wrapper around these preference fields to make them observable (using rxjava). It is possible to make it work as follows:
I am obliged to use reflection to get the methods I need. I know these methods are there, so I ignore error handling. Therefore, it would be better practice to simply expose these methods to avoid having to use this approach? Or maybe I am doing something wrong?
Hi,
Is there a reason why the preference fields for shared preferences do not share a common interface that exposes the get and put methods? They all extend AbstractPrefField and all implement a get and put method, but it is not enforced.
However, (to clarify why I ask this question) I am trying to create a wrapper around these preference fields to make them observable (using rxjava). It is possible to make it work as follows:
I am obliged to use reflection to get the methods I need. I know these methods are there, so I ignore error handling. Therefore, it would be better practice to simply expose these methods to avoid having to use this approach? Or maybe I am doing something wrong?
Cheers,
Christophe