Search code examples
androidtoastandroid-theme

How to set toast style as a theme?


I want to change all toasts in my App by editing themes.xml.

I am using <item name="buttonStyle">@style/MyButton</item> to change my buttons, is there something similar with Toasts, or do I have to create and use MyToast class which extends the built-in Toast?


Solution

  • You can change the background of your Toast with this:

    <style name="myTheme" parent="@android:styles/Theme.Holo">
      <item name="android:toastFrameBackground">@android:drawable/my_toast</item>
    </style>