I am trying to display text in the Status Bar of Android Nougat just as time is displayed. I can display icons using NotificationCompat.Builder
but not text. How to proceed?
Asked
Active
Viewed 1,293 times
2

Aroonalok
- 631
- 1
- 7
- 18
-
As far as I'm aware, text isn't displayed in the status bar as of Lollipop. This used to be possible with the `setTicker` method. – PPartisan Feb 22 '18 at 11:07
-
Yes. I tried to `setTicker` method but it didn't work. However, there are some apps like Internet Speed Meter Lite that display text in Android N. I wonder how ? – Aroonalok Feb 22 '18 at 11:11
-
Did you found this answer: https://stackoverflow.com/a/45392031/5272951 ? – Dumbo Feb 22 '18 at 11:13
-
@EJusius I found it and tried to incorporate it. Did not work. – Aroonalok Feb 22 '18 at 11:21
-
https://stackoverflow.com/questions/5840166/how-to-set-text-on-status-bar-notification-in-android?rq=1 – Hoque MD Zahidul Feb 26 '18 at 03:48
2 Answers
0
If you're using NotificationCompat.Builder
you can set text there
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.notification_icon)
.setContentTitle("My notification")
.setContentText("Hello World!")
You can also address this

Rainmaker
- 10,294
- 9
- 54
- 89