0

I want to show a custom notification designed by the user as the notification. For example, I have the following notification:

<h2>
    <span style="background-color: rgb(255, 156, 0);">Testing</span> 
    <u style="">HTML</u>&nbsp;
    <span style="font-weight: 400;">tags </span>
    <span style="background-color: rgb(231, 99, 99);">highlight</span> 
    <span style="font-weight: 400;"> test.</span>
</h2>

I use Spanned htmlText = Html.fromHtml(msg); to parse the message. When notification is shown I do see the bold text and the underline text, but I don't see anything highlighted. Is there anyway to achieve it and show the colours, or Android simply doesn't support it?

Keselme
  • 3,779
  • 7
  • 36
  • 68
  • Well! Its good to say its work on condition when `App` in `Foreground` but it will not work when app in `background`! – Nick Bapu May 27 '19 at 06:40
  • When the app is in foreground I still don't see the colour. When it's in the background I see the message with all the html tags - but this is server side issue and I will deal with it later. Currently I want to display the highlighted text and it doesn't work. – Keselme May 27 '19 at 06:44
  • You might want to switch custom remote views – hemen May 27 '19 at 07:10

0 Answers0