android7.0 SharedPreferences 触发 SecurityException

 

Starting from N(N is for Nougat), attempting to use this mode will throw a SecurityException.
7.0后不能这样用了。
解决办法就是:Use more formal mechanism for interactions such as ContentProviderBroadcastReceiver, and Service.

发现MODE_WORLD_READABLE 模式已经被废弃。

Context.MODE_WORLD_READABLE或Context.MODE_WORLD_WRITEABLE 模式换成 MODE_PRIVATE

    原文作者:御诺诺诺诺诺诺诺
    原文地址: https://blog.csdn.net/nuonuonuonuonuo/article/details/81982956
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞