|
|
@@ -2,11 +2,13 @@ package com.hola;
|
|
|
|
|
|
import static android.app.Notification.EXTRA_NOTIFICATION_ID;
|
|
|
|
|
|
+import android.app.AlarmManager;
|
|
|
import android.app.NotificationManager;
|
|
|
import android.app.PendingIntent;
|
|
|
import android.content.BroadcastReceiver;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
+import android.os.SystemClock;
|
|
|
import android.util.Log;
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
@@ -81,6 +83,19 @@ public class AlarmReceiver extends BroadcastReceiver {
|
|
|
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
|
|
|
|
|
|
notificationManager.notify(msg_id, builder.build());
|
|
|
+
|
|
|
+ repeatNotify(context);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void repeatNotify(Context context){
|
|
|
+ Intent intent = new Intent(context, AlarmReceiver.class);
|
|
|
+ intent.putExtra("title", "title");
|
|
|
+ intent.putExtra("message", "body");
|
|
|
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(
|
|
|
+ context, 0, intent, android.app.PendingIntent.FLAG_UPDATE_CURRENT);
|
|
|
+
|
|
|
+ AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
|
|
|
+ alarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime()+10*1000,pendingIntent);
|
|
|
}
|
|
|
|
|
|
// @Override
|