Search code examples
javaandroidandroid-resourcesandroid-themeandroid-styles

Toast inheriting theme background


I'm having an issue with developing on Android that I have tested on multiple devices and am having the same issues on all devices.

I'm creating a style named SplashTheme, in which I am setting android:background to a green color which matches my app identity. The issue I am having is whenever I create a Toast in this activity, the Toast is partially green. I have tried removing the styling to android:background and it resolves the issue, however, I am needing to style the background in that way.

Any ideas as to why this could be happening?


Solution

  • Instead of:

    <item name="android:background">@color/your_color</item>
    

    Do:

    <item name="android:windowBackground">@color/your_color</item>