Last week we covered how toast happens in Android Studio. Today, we’re going to make it a tad more dynamic with an if/else statement. Going back to this Riddler App, I want to add hints for the user if they can’t guess the answer outright. Quick reminder, our test riddle was “What has a neck but no head?” Most people start guessing insects for that one (isn’t an earthworm basically all neck? you might argue), but the answer we’re looking for is “A Bottle.”
To keep the mystery alive, we’re going to keep hints semi-living creatures related. If a user hits the Hint button once, a toast message will pop out reading, “It has no fingers or toes either.” Otherwise, the toast will say, “And lives all over the world.”