context.mode_private: As the default mode of operation, which means that the file is private data and can only be accessed by the app itself, in which the content of the write overwrites the contents of the original file, if you want to append the newly written content to the original file. You can use Context.mode_append
context.mode_append: The mode checks whether the file exists, appends content to the file, or creates a new file.
Context.mode_world_readable and context.mode_world_writeable are used to control whether other apps have permission to read and write to the file.
mode_world_readable: Indicates that the current file can be read by another application;
mode_world_writeable: Indicates that the current file can be written by another application.
Sharedpreferences mode, activity.mode_private and activity.mode_append difference is what ah, Online said a will cover, a will append, but I use when seemingly are added Ah, beg high finger teach!!
1. That is the constant of the context
2. For sharedpreferences, the use of mode_append is meaningless, this flag indicates that the file can be appended, that is, you can continue to write to a txt, and mode_private live other will overwrite the file
So you understand the "All is append" wrong, because Sharedpreferences could have stored multiple values, there is no append problem, he is an XML file, different keys are different when they are stored in the item
Four types of Android enumeration context.mode_private