源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Android 跨进程SharedPreferences异常详解

  • 时间:2022-08-28 22:35 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Android 跨进程SharedPreferences异常详解
[b]Android 跨进程SharedPreferences异常详解[/b]
Context c = null;
    try {
      c = context.createPackageContext(PREFERENCE_PACKAGE,
          Context.CONTEXT_IGNORE_SECURITY);
    } catch (NameNotFoundException e) {
      e.printStackTrace();
    }
    if (c != null) {
      SharedPreferences infoSp = c.getSharedPreferences(PREFERENCE_NAME,
          Context.MODE_MULTI_PROCESS);
      int status = infoSp.getInt("break", 1);
      Logcat.d("br" + status);
      return 0 == status;
    } else {
      Logcat.w("brake_status error.... c==null ");
    }
    return false;
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部