android getDefaultSharedPreferences doesn't get applied -
i'm new android development , i'm working on fixing bugs. app shouldn't load previous preference load instead of loading default values. here have in main activity preferencemanager.setdefaultvalues(this, r.xml.preferences, false); // register listener sharedpreferences changes preferencemanager.getdefaultsharedpreferences(this).registeronsharedpreferencechangelistener(preferencechangelistener); quizfragment quizfragment = (quizfragment) getfragmentmanager().findfragmentbyid(r.id.quizfragment); quizfragment.updateguessrows(preferencemanager.getdefaultsharedpreferences(this)); quizfragment.updateregions(preferencemanager.getdefaultsharedpreferences(this)); quizfragment.updatenumberquestions(preferencemanager.getdefaultsharedpreferences(this)); and here full code https://github.com/jamin567/android try way: final string eulakey = "mykey"; context mcontext = getapplicationcontext(); mprefs = m