Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: Managing multiple notifications in status bar
    primarykey
    data
    text
    <p>I am creating a multiple stop watch application for which there will be multiple timers running parallel, and each notification binded to each timer. </p> <p>I am able to create multiple timers with the following code. </p> <pre><code>private void updateNotification(int notificationId, int clockStatusID, CharSequence text) { // notificationManager.cancel(notificationId); // throws up an ongoing notification that the timer is running Log.i("TIMERCOUNT", "Notification id: " + notificationId); Notification not = new Notification(clockStatusID, // the // icon // for // the // status // bar text, // the text to display in the ticker System.currentTimeMillis() // the timestamp for the // notification to appear ); Intent intent = new Intent(); intent.setClassName("com.intuit.time_catcher.android.activities", "com.intuit.time_catcher.android.activities.Tabs"); not.setLatestEventInfo(self, getText(R.string.timer_notification_title), getText(R.string.timer_on_notification_text), PendingIntent .getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)); not.flags += Notification.FLAG_ONGOING_EVENT; not.flags += Notification.FLAG_NO_CLEAR; notificationManager.notify(notificationId, not); } </code></pre> <p>The following is the problem that im facing. Consider there are 3 timer running and 3 notifications in the status bar. When i update timer 2, notification 3(which is at the rightmost end) gets updated, but what i really want to do is to update the second notification(middle one). When i print the notification id's, im seeing the right values. I cant comprehend why am i getting this weird behavior?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload