Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change values in the shared preference

Tags:

I've created an application which uses a shared preference in order for the user to login. The password of the user is saved in the preference. My problem is, how can I change the password in the preference if the user wants to change his/her password?

like image 291
sean Avatar asked Jan 28 '11 03:01

sean


1 Answers

SharedPreferences prefs = ... // you already know how to use prefs and have one of this objects Editor editor = prefs.edit(); editor.putString("password", "new value"); editor.apply(); 
like image 101
Cristian Avatar answered Nov 04 '22 06:11

Cristian