User Preferance
User Preferance
The first parameter is the key and the second parameter is the MODE.
Apart from private there are other modes available that are listed
below –
1 MODE_APPEND
This will append the new preferences with the already existing
preferences
2 MODE_ENABLE_WRITE_AHEAD_LOGGING
Database open flag. When it is set , it would enable write ahead
logging by default
3 MODE_MULTI_PROCESS
This method will check for modification of preferences even if
the sharedpreference instance has already been loaded
4 MODE_PRIVATE
By setting this mode, the file can only be accessed using calling
application
5 MODE_WORLD_READABLE
This mode allow other application to read the preferences
6 MODE_WORLD_WRITEABLE
This mode allow other application to write the preferences
1 apply()
It is an abstract method. It will commit your changes back from
editor to the sharedPreference object you are calling
2 clear()
It will remove all values from the editor
3 remove(String key)
It will remove the value whose key has been passed as a
parameter