我是 shopify 的新手 我正在 Android 应用程序中处理 shopify 的客户登录。 我想在登录之前检查用户的凭据。 那么有什么办法可以做到吗?
最佳答案
如果第一次登录用户名,密码存储在sharedprefrences中,则您使用了共享prefrences,下次检查从共享prefrences获取数据。
公共(public)类首选项{ 静态上下文 mContext;
public static void setPreferences(Context context, String key, String value) {
mContext = context;
SharedPreferences.Editor editor = mContext.getSharedPreferences(
"ParkZap", Context.MODE_PRIVATE).edit();
editor.putString(key, value);
editor.commit();
}
public static String getPreferences(Context context, String key) {
mContext = context;
SharedPreferences prefs = mContext.getSharedPreferences("ParkZap",
Context.MODE_PRIVATE);
String position = prefs.getString(key, "");
return position;
}
关于android - Shopify 客户登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34489011/