| Start |
|---|
| Basic Toast Message First, instantiate a Toast object with one of the This example demonstrates everything you need for most toast notifications. You should rarely need anything else. You may, however, want to position the toast differently or even use your own layout instead of a simple text message. The following sections describe how you can do these things. You can also chain your methods, call as a one-liner and avoid holding on to the Toast object, like this: For more information refer to the more complete Android documentation (opens new window) on the topic. |
| Colored Toast Messages Sometimes we want to give extra information to our user with colors (for example red means something wrong has happened) We can change toast message background color using setting a color filter to the view which our toast give us (here I use a ColorMatrixColorFilter (opens new window)): And also we can change the text color if background is light or dark: |
| Change Toast Position We can change our toast using SetGravity method. This method takes three parameters: first is gravity of toast on screen and two others set toast offset from the starting position (which is set by the first parameter): |
Read Article
https://develop.horje.com/learn/1434/reference