6.3 Technologies Overview
This section presents the new technologies that we use in the Cannon Game app in the order they’re encountered in the chapter.
6.3.1 Using the Resource Folder res/raw
Media files, such as the sounds used in the Cannon Game app, are placed in the app’s resource folder res/raw
. Section 6.4.5 discusses how to create this folder. You’ll copy the app’s sound files into it.
6.3.2 Activity
and Fragment
Lifecycle Methods
We introduced Activity
and Fragment
lifecycle methods in Section 5.3.1. This app uses Fragment
lifecycle method onDestroy
. When an Activity
is shut down, its onDestroy
method is called, which in turn calls the onDestroy
methods of all the Fragment
s hosted by the Activity
. We use this method in the MainActivityFragment ...
Get Android How to Program, 3/e 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.