I have an application which uses AlarmManager to schedule Notifications if there is any event coming up. This works well.
The problem is that every time the user instantiates the application, it displays the StatusBar Notification if it is the Event day. I would like to show the StatusBar Notification only when the app is not active (ie. closed).
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_calendar_view);
if (notification_value == true) {
int dayOfEvent = day;
if (notification_day == 1) {
dayOfEvent = day + 1;
}
if(isHoliday(dayOfEvent, month, year))
{
String mn = monthName[month-1];
String date_string = setParameter(year, mn, dayOfEvent);
startAlarm(year, (month-1), day, hour, mins, date_string);
}
}
}