Hour() {String time = getPersistedString(this.defaultValue);if (time == null || !time.matches(VALIDATION_EXPRESSION)) {return -1; } return Integer.valueOf(time.split(":")[0]); } /** * Get the minute value * * @return the minute value, will be 0 to 59 (inclusive) */private int getMinute() {String time = getPersistedString(this.defaultValue);if (time == null || !time.matches(VALIDATION_EXPRESSION)) {return -1; } return Integer.valueOf(time.split(":")); } private String packageTimeInfo(String time){String times = time.split(":");StringBuffer sb = new StringBuffer();sb.append(times[0]).append("时");if(times.length() < 2){sb.append("0"); } sb.append(times).append("分");return sb.toString(); } } 在覆盖相应的方法中写入sharedpreference文件就ok。。。