December 2013
Intermediate to advanced
464 pages
14h 46m
English
The settings activity’s function is relatively simple. When a user presses one of the choices, that value is stored as a key/value pair in SharedPreferences. When the page is accessed, the activity reads the stored preferences and sets the RadioButtons to the stored value. The value stored in a SharedPreferences is used in ContactListActivity to sort the list of saved contacts.
Open the ContactSettingsActivity.java file and complete the following steps:
1. Copy the ImageButton initialization methods from the ContactActivity.java to the ContactSettingsActivity.java file so that the navigation bar will work. These methods are initMapButton(), initListButton(), and initSettingsButton(). Paste this code before the last
Read now
Unlock full access