Hi!
I'm developing a calendar application with notification features but i'm a
little confused about to implement an notification:
I know how to setup the notification manager and send notifications but i
don't know how to set a service for shedule the notifications (from 1 day
to many months on the future).
I have read about alarmmanager and also i tested a example, but i'm stuck
about shedule many alarms (if is good idea do this) or if exists another
way to solve this problem.
My code is this:
@Override
public void onClick(View v) {
if(chbx.isChecked()){
Evento evnt=eventos.get(position);
evnt.setStatus(true);
DbAdapter data=new DbAdapter(v.getContext());
data.open();
data.updateEvent(evnt.getIdEvento(),evnt);
*setAlarm(v.getContext());*
dialog.cancel();
data.close();
}else
dialog.cancel();
}
}
);
And the method "setAlarm()" is this:
private void setAlarm(Context context){
PendingIntent mAlarmSender=PendingIntent.getBroadcast(context,343, new
Intent("com.siitne.candelaria.notificationSystem.AvisoReceiver.class"), 0);
AlarmManager alm=(AlarmManager)context.getSystemService(ALARM_SERVICE);
alm.set(AlarmManager.RTC_WAKEUP,
System.currentTimeMillis()+(5*1000),mAlarmSender);
}
I made this question on stackoverflow but i don't get any answer , i'm very
beginner using AlarmManager, it's the first time using a service for notify
future events so any help will be useful :)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en