Return super onOptionsItemSelected
However, that is all that is needed, and it really is not that much code outside of the preferences XML. What you get for your effort is an Android‑supplied preference UI, as shown in Figure 17‑1.
Figure 17‑1. The Simple project’s preferences UI
The checkbox can be directly checked or unchecked. To change the ringtone preference, just click on the entry in the preference list to bring up a selection dialog like the one in Figure 17‑2.
Figure 17‑2. Choosing a ringtone preference
Note that there is no explicit Save or Commit button or menu – changes are persisted as soon as they are made.
The activity, beyond having the aforementioned menu, also displays the current preferences via a :
The fields for the table are found in :
Дата добавления: 2015-05-16; просмотров: 1179;