I'm using this tutorial
to show a notification with a progress bar.
Everything works fine.
But I can not make the progress dissapear when the task is 100% done
How can I do this? tx
Here it is:
Notification.setProgress(0, 0, false);
Where the first param stands for min and the second param stands for the maximum value. Don’t forget to call:
Notification.notify(id, NotificationManager);
I found a "solution" that works.
Just call a new RemoteView with no progress bar on it's layout when the task is done
In the tutorial I use I have this progress.xml called:
notification.contentView
= new RemoteViews(getApplicationContext().getPackageName(), R.layout.progress);
when the task is 100% done call:
notification.contentView =
new RemoteViews(getApplicationContext().getPackageName(), R.layout.done);
so layout done.xml replaces progress.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With