NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
builder.setContentTitle(description.getTitle())
.setAutoCancel(false);
NotificationManager notificationManager=(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
Notification notificationCompat=builder.build();
notificationManager.notify(MY_ID,notificationCompat);
startForeground(MY_ID,notificationCompat);
Utilisé ci-dessus code pour exécuter le service en arrière-plan. Mais lorsque l'activité fermée, appel de service OnDestroyComment utiliser startForeground avec NotificationCompat.Builder?
"ne fonctionne pas"? Qu'est-ce qui ne fonctionne pas? –
lorsque l'affichage s'éteint appels de service onDestroy –