alarmmanager에 PendingIntent를 사용하여
Intent intent = new Intent(ServiceClass.this,alarmReceiver.class);
PendingIntent sender = PendingIntent.getActivity(mContext, alarmId, intent, PendingIntent.FLAG_CANCEL_CURRENT);
mManager = (AlarmManager)getSystemService(ALARM_SERVICE);
calendar.set(Calendar.HOUR_OF_DAY, h);
calendar.set(Calendar.MINUTE, m);
calendar.set(Calendar.SECOND, 0);
mManager = (AlarmManager)getSystemService(ALARM_SERVICE);
//알람 시간
long oneday = 24 * 60 * 60 * 1000;// 24시간
mManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), oneday, sender);
위와 같이 구성할 경우 해당 시간이 되면 alarmReceiver Activity가 실행이 됩니다.
제가 특정 Activity가 실행되고 있을 경우에만 alarmReceiver가 실행이 되도록 하고 싶은데
그렇게 할수 있는 방법이 없을까요?