When opening SharedPreferences, use the MODE_MULTI_PROCESS flag. This was a legacy (but undocumented) behavior in and before Gingerbread (Android 2.3), and this flag is implied when targeting such releases. For applications targeting SDK versions larger than Android 2.3, this flag should be explicitly set as desired.
This constant was deprecated at API level 23.
MODE_MULTI_PROCESS does not work reliably in some versions of Android and, in addition, does not provide any mechanism for coordinating simultaneous changes between processes. Applications should not attempt to use it. Instead, they should use an explicit cross-data management process, such as ContentProvider .
source share