2

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?

Aroonalok
  • 631
  • 1
  • 7
  • 18

2 Answers2

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
0

Solved the problem by converting String to Bitmap. Got the idea from here

Aroonalok
  • 631
  • 1
  • 7
  • 18