1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
public void notifyme () {
NotificationManager notificationManager;
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(2009);
long durée1minute = 1000*60;
long temp =System.currentTimeMillis() + (120 * durée1minute);
Notification notification = new Notification(R.drawable.icon,"Gestion de vos lentilles de contact",temp);
notification.vibrate = new long[] {0,100,25,100};
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this,Main.class ), 0);
String titreNotification ="Gestion de vos lentilles de contact";
String textNotification = "Vous devez bientôt changer vos lentilles de contact";
notification.setLatestEventInfo(this, titreNotification, textNotification, pendingIntent);
int idRefNotification = 2009;
notificationManager.notify(idRefNotification,notification);
}
Cordialement
Sébastien |
Partager