首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

关于跨进程使用 getSharedPreferences 的有关问题

2012-07-16 
关于跨进程使用 getSharedPreferences 的问题?public static final int?MODE_MULTI_PROCESSSharedPreferen

关于跨进程使用 getSharedPreferences 的问题

?

public static final int?MODE_MULTI_PROCESS

SharedPreference loading flag: when set, the file on disk will be checked for modification even if the shared preferences instance is already loaded in this process. This behavior is sometimes desired in cases where the application has multiple processes, all writing to the same SharedPreferences file. Generally there are better forms of communication between processes, though.

This was the legacy (but undocumented) behavior in and before Gingerbread (Android 2.3) and this flag is implied when targetting such releases. For applications targetting SDK versions?greater than?Android 2.3, this flag must be explicitly set if desired.

See Also
  • getSharedPreferences(String, int)

热点排行