- #1
Darkmisc
- 220
- 31
- TL;DR Summary
- I'd like to run a timer in a foreground notification. I thought I could use the setContextText command for this, but it doesn't change the text in the notification at all.
Hi everyone
I'd like to make a timer that continues to run on the lock screen after the power button is pressed. I thought I could use a foreground notification for this and used code from this page:
In particular, I thought I could modify the following lines of code:
However, it seems setContentText and setContentTitle do nothing. No matter what I put in the quotation marks, my notification title is " Timer is running" and the text is "Tap for more information or to stop the app".
How do I change the text and title?
Thanks
I'd like to make a timer that continues to run on the lock screen after the power button is pressed. I thought I could use a foreground notification for this and used code from this page:
In particular, I thought I could modify the following lines of code:
notification:
Notification.Builder notification = new Notification.Builder(this, CHANNELID)
.setContentText("Activity Recognition is running....")
.setContentTitle("Obesity Point");
However, it seems setContentText and setContentTitle do nothing. No matter what I put in the quotation marks, my notification title is " Timer is running" and the text is "Tap for more information or to stop the app".
How do I change the text and title?
Thanks