D/StrictMode: StrictMode policy violation; ~duration=116 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65599 violation=2
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1440)
at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
at java.io.File.exists(File.java:807)
at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:572)
at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:563)
at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:519)
at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:714)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:368)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
at android.preference.PreferenceManager.getSharedPreferences(PreferenceManager.java:510)
at android.preference.Preference.getSharedPreferences(Preference.java:1204)
at com.rarepebble.colorpicker.ColorPreference.getPersistedIntDefaultOrNull(ColorPreference.java:120)
at com.rarepebble.colorpicker.ColorPreference.onBindView(ColorPreference.java:71)
Thanks
Edit: after some investigation, I see that this is how Preferences are generally designed to work.
But as an improvement, you may omit using getSharedPreferences() in case isPersistent() is false.
In my case I do not store this color under the default storage provided by the Preference, so I would like to have the ability to disable this behavior with isPersistent flag.
Hello
Please see this StrictMode report
Thanks
Edit: after some investigation, I see that this is how Preferences are generally designed to work. But as an improvement, you may omit using
getSharedPreferences()
in caseisPersistent()
is false.In my case I do not store this color under the default storage provided by the Preference, so I would like to have the ability to disable this behavior with
isPersistent
flag.