Problem with SharedPreferences

Posted by user547995 on Stack Overflow See other posts from Stack Overflow or by user547995
Published on 2010-12-27T12:43:22Z Indexed on 2010/12/27 12:54 UTC
Read the original article Hit count: 228

Filed under:
|

Code for restore:

final SharedPreferences settings = getSharedPreferences("pref", 0);
        settings.getString("user", "");
        settings.getString("pw", "");

Code for store:

SharedPreferences.Editor editor = settings.edit();
                      editor.putString("user", etuser.getText().toString());
                      editor.putString("pw", etpw.getText().toString());
                      editor.commit();

This code don't work, and no error occur

© Stack Overflow or respective owner

Related posts about android

Related posts about sharedpreferences