/*** 设置当前用户的签到信息* account&info;account&info** @param context* @param sign* @author jrjin* @time 2016-1-5 下午2:27:47*/public static void setSignInfo(Context context, String sign) {String account = getAccount(context);if (TextUtils.isEmpty(account)) return;String signs = getSigninfos(context);if (TextUtils.isEmpty(signs)) {signs = account + "&" + sign;} else {StringBuilder builder = new StringBuilder();String[] modules = signs.split(";");String[] time = null;boolean added = false;for (String module : modules) {time = module.split("&");if (time[0].equals(account)) {builder.append(account + "&" + sign + ";");added = true;} else {// 直接添加builder.append(module + ";");}}if (!added) {builder.append(account + "&" + sign + ";");}// 去除最后一个";"signs = builder.toString();signs = signs.substring(0, signs.length() - 1);}SharedPreferences sp = context.getSharedPreferences(SETTING_PREFERENCES, Context.MODE_PRIVATE);SharedPreferences.Editor editor = sp.edit();editor.putString(PREFERENCE_KEY_SIGN_INFO, signs);editor.commit();}private static String getSigninfos(Context context) {SharedPreferences sp = context.getSharedPreferences(SETTING_PREFERENCES, Context.MODE_PRIVATE);String signs = sp.getString(PREFERENCE_KEY_SIGN_INFO, "");return signs;}