Press the button to toggle between date and time.
The current preference will be saved.
See
Shared
Preferences.
Saving
Persistent State
says that an
Activity
should save its preferences in the
Activity
’s
onPause
method.
We got the mode bits
rw-rw----
because we created the file with
MODE_PRIVATE
.
adb shell # cd /data/data/edu.nyu.scps.preferences/shared_prefs # pwd
# ls -l -rw-rw---- app_34 app_34 112 2011-05-04 10:38 preferencesFilename.xml
# cat preferencesFilename.xml <?xml version='1.0' encoding='utf-8' standalone='yes' ?> <map> <boolean name="showDate" value="false" /> </map>
# exit
# cd # adb pull /data/data/edu.nyu.scps.preferences/shared_prefs/preferencesFilename.xml 5 KB/s (111 bytes in 0.019s) # exit
ls -l preferencesFilename.xml -rw-r--r-- 1 myname staff 111 May 4 11:07 preferencesFilename.xml
PreferenceActivity
and reads the ptreferences from
preferences.xml
.
#5 is Prefercnes from code;
it looks exactly the same.Activity
that uses an
Intent
object to launch an
Activity
that extends
PreferenceActivity
.
It receives the result in
onActivityResult
.