2

How can I specify android Notification so that the text is visible on all devices? Some devices has black background in the notification area, and if the text is black, it is not visible. And other devices has white background in the notification area.

Thank you.

SnowyTracks
  • 1,965
  • 15
  • 21
michael
  • 106,540
  • 116
  • 246
  • 346
  • possible duplicate of [Custom notification layouts and text colors](http://stackoverflow.com/questions/4867338/custom-notification-layouts-and-text-colors) – eldarerathis Nov 08 '11 at 20:10

3 Answers3

1

You can access the systems color attributes and use it in your layout. Use for example

android:textColor="?android:textColorPrimary"

to set the text color of a TextView to the primary text color of the current theme. There are tons of other attributes, have a look at Referencing Style Attributes and the attributes list.

0

Use

android:textColor="?android:textColorPrimary"

and/or

android:textColor="?android:textColorSecondary"

in combination with

android:background="?android:colorBackground"

This refers to native attributes in the current style, so that your notification will always be legible.

wvdz
  • 16,251
  • 4
  • 53
  • 90
0

You should create your own view with a set background, and display your text using that. :)

Check out the documentation to get some sample code.

Codeman
  • 12,157
  • 10
  • 53
  • 91