Display Messages with the Toast Class

Again, I feel compelled to clarify that Toast messages are intended to be small, brief alerts to users that something just happened. This may be some kind of processing or that they’ve been logged out of their account. With that being said, they can be handy for troubleshooting as well, similar to something like window.alert with web development.

In this section, we’re going to cover how Toast messages work plus a couple of String-related concepts: a new toString on a data class and the joinToString function on a Collection. We’re going to use that function to get our player info first, then we’ll see how Toast messages work.

Use joinToString() to Get NewPlayer Info

To get the info about the players, we’re ...

Get Kotlin and Android Development featuring Jetpack now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.