I am using a PreferenceActivity to show some settings for my application. I am inflating the settings via a xml file so that my onCreate (and complete class methods) looks l
Try following source code it worked for me
//Fetching id from shared preferences SharedPreferences sharedPreferences; sharedPreferences =getSharedPreferences(Constant.SHARED_PREF_NAME, Context.MODE_PRIVATE); getUserLogin = sharedPreferences.getString(Constant.ID_SHARED_PREF, "");