欧美三级国产三级日韩三级_亚洲熟妇丰满大屁股熟妇_欧美亚洲成人一区二区三区_国产精品久久久久久模特

SharedPreferences使用經(jīng)驗 - 新聞資訊 - 云南小程序開發(fā)|云南軟件開發(fā)|云南網(wǎng)站建設(shè)-昆明葵宇信息科技有限公司

159-8711-8523

云南網(wǎng)建設(shè)/小程序開發(fā)/軟件開發(fā)

知識

不管是網(wǎng)站,軟件還是小程序,都要直接或間接能為您產(chǎn)生價值,我們在追求其視覺表現(xiàn)的同時,更側(cè)重于功能的便捷,營銷的便利,運營的高效,讓網(wǎng)站成為營銷工具,讓軟件能切實提升企業(yè)內(nèi)部管理水平和效率。優(yōu)秀的程序為后期升級提供便捷的支持!

您當(dāng)前位置>首頁 » 新聞資訊 » 技術(shù)分享 >

SharedPreferences使用經(jīng)驗

發(fā)表時間:2020-10-19

發(fā)布人:葵宇科技

瀏覽次數(shù):57


SharedPreferences應(yīng)用經(jīng)驗



int

MODE_APPEND


File creation mode: for use with openFileOutput(String, int), if the file already exists then write data to the end of the existing file instead of erasing it.

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.

int

MODE_PRIVATE

File creation mode: the default mode, where the created file can only be accessed by the calling application (or all applications sharing the same user ID).

int
MODE_WORLD_READABLE

File creation mode: allow all other applications to have read access to the created file.

int

MODE_WORLD_WRITEABLE

File creation mode: allow all other applications to have write access to the created file.

1、對于SharedPreferences來說,應(yīng)用MODE_APPEND是沒有意義的,這個標(biāo)記表示文件可以追加,即可以持續(xù)向一個txt瑯綾擎寫器械,而MODE_PRIVATE 活著其他  會覆蓋文件
2、當(dāng)應(yīng)用這幾種權(quán)限時,其他法度榜樣拜訪數(shù)據(jù)時啟動本法度榜樣修改文件數(shù)據(jù),其他法度榜樣獲得的┞氛樣緩存數(shù)據(jù)得不到最新的數(shù)據(jù),其他法度榜樣要想獲得最新數(shù)據(jù),本法度榜樣在寫文件時必須應(yīng)用MODE_MULTI_PROCESS權(quán)限。
如不雅不經(jīng)由過程創(chuàng)建Context拜訪其他應(yīng)用的preference,可以以攫取xml文件方法直接拜訪其他應(yīng)用preference對應(yīng)的xml文件

相關(guān)案例查看更多