| | |
| | | return sp.getBoolean("isLogin", false); |
| | | } |
| | | |
| | | public static void setInviteCode(Context context, String uid, String inviteCode) { |
| | | public static void setInviteCode(Context context, String inviteCode) { |
| | | SharedPreferences sp = context.getSharedPreferences("user-info", Context.MODE_PRIVATE); |
| | | SharedPreferences.Editor editor = sp.edit(); |
| | | editor.putString("inviteCode", inviteCode); |
| | | editor.commit(); |
| | | } |
| | | |
| | | public static String getInviteCode(Context context, String uid) { |
| | | public static String getInviteCode(Context context) { |
| | | SharedPreferences sp = context.getSharedPreferences("user-info", Context.MODE_PRIVATE); |
| | | return sp.getString("inviteCode", ""); |
| | | } |
| | |
| | | public static UserLoginStatus getLoginState(Context context) { |
| | | boolean isLogin = isLogin(context); |
| | | if (isLogin) { |
| | | String inviteCode = getInviteCode(context, getUid(context) + ""); |
| | | String inviteCode = getInviteCode(context); |
| | | if (StringUtils.isNullOrEmpty(inviteCode)) |
| | | return UserLoginStatus.LOINGED_NO_ACTIVE; |
| | | else |