My app will allow user to set desired time on which activity will trigger. I used AlarmManager to open activity. Below is the code for same.`
/* Intent intent = new Intent(this, AlarmNotificationActivity.class);
PendingIntent pendingIntent=PendingIntent.getActivity(getBaseContext(), RQS_1, intent,
0);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, targetCal.getTimeInMillis(),interaval, pendingIntent);*/
Intent intent = new Intent(this, AlarmReceiver.class);
PendingIntent pendingIntent=PendingIntent.getBroadcast(getBaseContext(), RQS_1, intent,
0);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, targetCal.getTimeInMillis(),interaval, pendingIntent);
If I use the PendingIntent with getActivity even the app killed AlarmNotification is came up.
If I use the PendingIntent with getBroadcast if the app killed AlarmNotification is not coming up.
Question is After clearing the app process from task list Is it possible to trigger Notification Activity of my app through broadcast.
If Yes - Please share any link or sample code (TIA)
If No - How Clock App in Mobile triggers Alarm on specific time. Do I need to define service to achieve this.