Using shared preferences I saved data in one of the activity Now I want to use that data in another activity how to do that?
See Question&Answers more detail:osUsing shared preferences I saved data in one of the activity Now I want to use that data in another activity how to do that?
See Question&Answers more detail:osCreate a sharedPreference where you want to add shared data. A little example of code like this:
SharedPreferences prefs = this.getSharedPreferences("CONSTANT_FILE_NAME",
Context.MODE_PRIVATE);
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean("isPaid", true);
editor.commit();
And to retrieve that shared data use this code:
SharedPreferences prefs = this.getSharedPreferences("CONSTANT_FILE_NAME",
Context.MODE_PRIVATE);
prefs.getBoolean("isPaid",false);
Read this from developer site: click here