How can I make a persistent notification, that will update every time the users sees it?
form the service
How can I make a persistent notification, that will update every time the users
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To show the notification when the
Serviceis running, you call:giving the method an ID for your service, and a
Notificationthat you have created.At any point, your
Servicecan update what the user sees by using the sameR.string.notification_idand posting a newNotification:For creating a
Notification, you need to read up onNotification.Builder(android docs here).There is also a good answer on a related question: How exactly to use Notification.Builder? Apologies for not reposting his answer, but it includes a lot of code and will sort you out.