Hi,
I have this exact same problem:
http://stackoverflow.com/questions/6189817/pin-notification-to-top-of-notification-area
The on-going notification shown the download progress..
I need to update those notifications periodically, every 3 seconds now:
I upgrade the progress bar and text informations.
When more then one file is being downloaded every time I refresh the
notifications they switch places for a split second.
I'm using an unique ID for each download when notifying.
Is there a way to tell Android "do NOT change position of my
notification, just update it's content"?
a snipped of code
Notification notification = new Notification();
notification.icon = R.drawable.ic_menu_notification;
// I tried with same when for every notification, no luck
notification.when = when;
notification.contentView = new RemoteViews(context.getPackageName(),
R.layout.download_notification);
notification.flags |= Notification.FLAG_ONGOING_EVENT;
notification.contentView.setTextViewText(R.id.download_notification_status,
notificationStatusText);
notification.contentView.setProgressBar(R.id.download_notification_progress,
10000, (int) (progress * 100.0f), false);
notificationManager.notify(downloadId, notification);
When I execute this for 2 download A and B I can see them switch
position in the status bar, when it happen on 2 is annoying, when you
are 3/4 download running it really sucks :/
I simplified the code for the sake of the example, I removed the Intent
part which is not related I think.
Thanks,
Daniele
--
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