Before we get too much further it’s important to test that our app is actually working. What we’re going to do is get the buttons to pop up a quick message just so we know they’re working. Copy the following code into your click methods:
Toast.makeText(getApplicationContext(), "Hit button clicked", Toast.LENGTH_SHORT).show();
A Toast is the Android way to have a message pop up on the screen. You can put it all on one line if you like but it wouldn’t fit on one line for this tutorial so I’ve split it up. You’ll also have to reset the imports by pressing Ctrl-Shift-O again but now when you test your app the buttons should respond, i.e:
This is what the app looks like on my Galaxy Nexus phone which is running Android 4.1. It has a much higher resolution than other Android phones so whatever you’re testing on could look vastly different. As long as your screen contains everything and the little message pops up when you click on your buttons. You’re ready to proceed.
If you’re having problems then it’s best you completely sort them out right now. Trying to forge on while you’ve got errors is futile, particularly since we’re now going to have to incorporate some slightly tricky code. If you have any problems that revision of the previous lessons can’t fix, then feel free to ask for help below.