Adding an About Box

Many apps have a button where you can get more information or help on the program. You may want to display credits about all the people who helped with the program, open source packages you used, or other legal information. For this example, we want to display a couple of paragraphs about how to play the game when the user presses the About button. The following screenshot shows what it will look like:

images/fig.tictactoe.about.png

To implement this, we need to add a few lines to the fragment’s onCreateView() method. Before returning the rootView, add this code:

ticTacToev1/src/main/java/org/example/tictactoe/MainFragment.java
Line 1 
// Handle buttons ...

Get Hello, Android, 4th Edition 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.