|
@@ -43,9 +43,11 @@ public class AlarmReceiver extends BroadcastReceiver {
|
|
|
.setContentIntent(pendingIntent);
|
|
.setContentIntent(pendingIntent);
|
|
|
|
|
|
|
|
assert categoryId != null;
|
|
assert categoryId != null;
|
|
|
|
|
+ int reminderId = 0;
|
|
|
if (categoryId.equals("REMINDER_FS_START_FAST")||
|
|
if (categoryId.equals("REMINDER_FS_START_FAST")||
|
|
|
categoryId.equals("REMINDER_FS_START_SLEEP")
|
|
categoryId.equals("REMINDER_FS_START_SLEEP")
|
|
|
){
|
|
){
|
|
|
|
|
+ reminderId = categoryId.equals("REMINDER_FS_START_FAST")?1:2;
|
|
|
Intent openAppIntent = new Intent(context, MainActivity.class);
|
|
Intent openAppIntent = new Intent(context, MainActivity.class);
|
|
|
openAppIntent.setAction("START_TIMER_NOW");
|
|
openAppIntent.setAction("START_TIMER_NOW");
|
|
|
openAppIntent.putExtra("id",strId);
|
|
openAppIntent.putExtra("id",strId);
|
|
@@ -64,6 +66,7 @@ public class AlarmReceiver extends BroadcastReceiver {
|
|
|
if (categoryId.equals("REMINDER_FS_END_FAST")||
|
|
if (categoryId.equals("REMINDER_FS_END_FAST")||
|
|
|
categoryId.equals("REMINDER_FS_END_SLEEP")
|
|
categoryId.equals("REMINDER_FS_END_SLEEP")
|
|
|
){
|
|
){
|
|
|
|
|
+ reminderId = categoryId.equals("REMINDER_FS_END_FAST")?3:4;
|
|
|
Intent openAppIntent = new Intent(context, MainActivity.class);
|
|
Intent openAppIntent = new Intent(context, MainActivity.class);
|
|
|
openAppIntent.setAction("END_TIMER_NOW");
|
|
openAppIntent.setAction("END_TIMER_NOW");
|
|
|
openAppIntent.putExtra("id",strId);
|
|
openAppIntent.putExtra("id",strId);
|
|
@@ -83,7 +86,7 @@ public class AlarmReceiver extends BroadcastReceiver {
|
|
|
// 显示通知
|
|
// 显示通知
|
|
|
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
|
|
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
|
|
|
|
|
|
|
|
- notificationManager.notify(msg_id, builder.build());
|
|
|
|
|
|
|
+ notificationManager.notify(reminderId, builder.build());
|
|
|
|
|
|
|
|
Log.i("set alarm status:",mode);
|
|
Log.i("set alarm status:",mode);
|
|
|
if (mode.equals("RECURRING")){
|
|
if (mode.equals("RECURRING")){
|