Now, onSharedPreferencesChanged does not use the activity to avoid
problems if the fragment it's not attached (for retrieve resources, it
was necessary, is used the saved applicationContext). Two bug fixes in
this class, related to previous commits: preferences edited without
commit and onConnected little logic error).