private void notifyTime() { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) { return; } int xx = calendar.get(Calendar.HOUR_OF_DAY); int xx2 = calendar.get(Calendar.MINUTE) + xx * 60; if (xx2 > (8 * 60 + 55) && xx2 < (8 * 60 + 59)) { if (StockNewSettingUtils.getTime_0900(mContent)) { String tip = null; tip = "开盘时间快到了"; Notification notification = NotificationUtils.creatNotify(mContent, tip, false); NotificationManager manager = (NotificationManager) mContent.getSystemService(mContent.NOTIFICATION_SERVICE); manager.notify(CommonUtils.notify_time_id, notification); } } else if (xx2 > (11 * 60 + 25) && xx2 < (11 * 60 + 29)) { if (StockNewSettingUtils.getTime_1130(mContent)) { String tip = null; tip = "上午结束时间快到了"; Notification notification = NotificationUtils.creatNotify(mContent, tip, false); NotificationManager manager = (NotificationManager) mContent.getSystemService(mContent.NOTIFICATION_SERVICE); manager.notify(CommonUtils.notify_time_id, notification); } } else if (xx2 > (12 * 60 + 55) && xx2 < (12 * 60 + 59)) { if (StockNewSettingUtils.getTime_1300(mContent)) { String tip = null; tip = "下午开盘时间快到了"; Notification notification = NotificationUtils.creatNotify(mContent, tip, false); NotificationManager manager = (NotificationManager) mContent.getSystemService(mContent.NOTIFICATION_SERVICE); manager.notify(CommonUtils.notify_time_id, notification); } } else if (xx2 > (14 * 60 + 55) && xx2 < (14 * 60 + 59)) { if (StockNewSettingUtils.getTime_1500(mContent)) { String tip = null; tip = "下午结束时间快到了"; Notification notification = NotificationUtils.creatNotify(mContent, tip, false); NotificationManager manager = (NotificationManager) mContent.getSystemService(mContent.NOTIFICATION_SERVICE); manager.notify(CommonUtils.notify_time_id, notification); } } else if (xx2 > (14 * 60 + 25) && xx2 < (14 * 60 + 29)) { if (StockNewSettingUtils.getTime_1430(mContent)) { String tip = null; tip = "神奇时间快到了"; Notification notification = NotificationUtils.creatNotify(mContent, tip, false); NotificationManager manager = (NotificationManager) mContent.getSystemService(mContent.NOTIFICATION_SERVICE); manager.notify(CommonUtils.notify_time_id, notification); } } }