[Android] mobile guard turns off automatic updates
There are four ways to save data: network, broadcast provider, shared preferences and database
Get the SharedPreferences object through getsharedpreferences() method. Parameters: name, mode
For example, config, mode_ PRIVATE
Call the edit () method of the SharedPreferences object to get the editor object
Call the putboolean () method of the editor object to put Boolean data. Parameters: key value pair, "update" false
Call the commit () method of the editor object to submit the data
View / data / data / package name / shared_ Perfs / config.xml is the generated XML file
Use the command line ADB shell CD to the above directory, and use the cat command to view the files
Call the getboolean () method of the SharedPreferences object to get the saved data. Parameters: key, default value
Judge, set the status to true, and set the text content
Setup check download section
Get the status of whether the saved is automatically updated, and judge the status
If the update is automatic, call the code that detects the automatic update
If you do not update automatically, delay two seconds and automatically jump to the home page
Call the postdelayed() method of the handler object. Parameters: runable object, the number of milliseconds delayed
Use the anonymous inner class to inherit the runable object, override the run () method, and jump to the home page
The textview part of the upgrade progress is hidden by default. Android: visibility = "gone" gone is the hidden and empty position
This moment is displayed in the callback function during the download process
Call setvisibility (view. Visible) of textview object
SettingActivity: