public static List<CanBie> allCanbie = new ArrayList();
根据当前的时间与数据库表存储时间来判断餐别
public static CanBie getCurrentCanbie() { long hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); long minutes = Calendar.getInstance().get(Calendar.MINUTE); long seconds = Calendar.getInstance().get(Calendar.SECOND); long now = hour * 60 * 60 + minutes * 60 + seconds; for (int i = 0; i < allCanbie.size(); i++) { CanBie cb = allCanbie.get(i); if (now > cb.CB_StartTime && now < cb.CB_EndTime) { return cb; } } return null; }