0

In my app I am using setError() method to show the error message. Throughout the app, the code for showing the erroe message remains same. However I noticed change in background color of the error message in one scenario even though the code for both cases are same as usual. Please refer the attached image below:

enter image description here

and this:

enter image description here

I want it to show the dark background in all cases. For the first case, the layout is a dialog and I am using a background style to it, which I am posting below.

 <style name="Dialog" parent="android:style/Theme.Dialog">
    <item name="android:windowBackground">@color/dialog_background</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowIsFloating">true</item>
</style>

Is there anything I am missing out? need your help. Thanks in advance.

Animesh Jena
  • 1,541
  • 1
  • 25
  • 44
  • 1
    Share layout code. Do they use the same theme? – Gokhan Arik Oct 17 '17 at 06:55
  • 1
    It might be because of your theme..... – Gaurav Oct 17 '17 at 06:56
  • 1
    This may help https://stackoverflow.com/questions/14413575/how-to-write-style-to-error-text-of-edittext-in-android?noredirect=1&lq=1 –  Oct 17 '17 at 06:56
  • Thank you. Let me go through once through the code for themes. – Animesh Jena Oct 17 '17 at 06:57
  • @GokhanArik: Actually I am using a diiferent Style for the first case dialog. Please find the updated code. – Animesh Jena Oct 17 '17 at 07:15
  • Looks like style for error popup is an internal style and background comes from the theme. You might want to change parent theme of the dialog. `mPopupInlineErrorBackgroundId = getResourceId(mPopupInlineErrorBackgroundId,com.android.internal.R.styleable.Theme_errorMessageBackground);` – Gokhan Arik Oct 17 '17 at 07:24
  • 1
    Try using `Theme.Holo.Dialog` or `Theme.Holo.Light.Dialog` – Gokhan Arik Oct 17 '17 at 07:29

0 Answers0