Добрый день!Я начал курс по многопоточности Андроид. И на занятии по уведомлениям заметил, что мои нотификации отображаются только лишь, когда startforeground(id:0). При других же значениях, приложение просто вылетает.
Можете объяснить, пожалуйста, как и с чем это связано. Заранее благодарю!
startForeground(0,mBuilder.setContentText("Text").build());
scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
@Override public void run() {
long currentTime = System.currentTimeMillis();
Notification notification = mBuilder.setContentText("Current time is" + currentTime).build();
Log.d(TAG, "run: " + currentTime);
mManager.notify(0,notification);
Intent intentToSend = new Intent(SimpleReceiver.SIMPLE_ACTION);
intentToSend.putExtra(TIME,currentTime);
sendBroadcast(intentToSend);
}