Adding a settings page to the Note To Self app
Now that we are armed with all this knowledge about Android Intents, we can add another screen (Activity) to our Note To Self app.
We will first create a new Activity and see what effect that has on the AndroidManifest.xml
file. We will then create a layout for our Settings screen and add the Java code to switch from MainActivity
to the new one. We will, however, defer wiring up our settings screen with Java until we have learned how to save those settings to disk. We will do this later in this chapter and then come back to the settings screen to make the data persist.
First, let's create that new Activity.
Creating SettingsActivity
This will be a screen where the user can turn on or off the sound effects as well as choose the speed of animations. Clearly, our app does not yet have sound and animations, but we can still fully code this screen and see how to save data to the device's permanent storage by following the given steps:
- In the...