【发布时间】:2012-04-04 16:41:17
【问题描述】:
我无法从 android 的 sharedpreferences 中检索用户名和密码。我使用此代码保存用户名并通过
SharedPreferences prefs=getSharedPreferences("File", 0);
SharedPreferences.Editor e= prefs.edit();
e.putString("Email", "example@example.com").putString("Password", "password1");
e.commit();
e.putString("Email", "example_2@example.com").putString("Password", "password2");
e.commit();
String s=prefs.getString("Email","not found");
但我不知道如何检索用户登录信息。谁能帮我弄清楚
【问题讨论】:
-
Java Hashmap的简单概念,查一下。
标签: android authentication login sharedpreferences