当前位置: 首页 > wzjs >正文

网络营销机构官方网站商业网站初期建设资金预算

网络营销机构官方网站,商业网站初期建设资金预算,thinkphp仿wordpress,电影网站怎么做要多少钱Android开发检查是否开启通知栏权限 检查通知权限很场景,几乎每个app都有。 顺便提供跳到设置里面开启通知栏 一、查询是否有通知栏权限: RequiresApi(api Build.VERSION_CODES.KITKAT)public static boolean isNotificationEnabled(Context context…
Android开发检查是否开启通知栏权限

检查通知权限很场景,几乎每个app都有。 顺便提供跳到设置里面开启通知栏

一、查询是否有通知栏权限:

@RequiresApi(api = Build.VERSION_CODES.KITKAT)public static boolean isNotificationEnabled(Context context) {if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {//8.0手机以上if (((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)).getImportance() == NotificationManager.IMPORTANCE_NONE) {return false;}}String CHECK_OP_NO_THROW = "checkOpNoThrow";String OP_POST_NOTIFICATION = "OP_POST_NOTIFICATION";AppOpsManager mAppOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);ApplicationInfo appInfo = context.getApplicationInfo();String pkg = context.getApplicationContext().getPackageName();int uid = appInfo.uid;Class appOpsClass = null;/* Context.APP_OPS_MANAGER */try {appOpsClass = Class.forName(AppOpsManager.class.getName());Method checkOpNoThrowMethod = appOpsClass.getMethod(CHECK_OP_NO_THROW, Integer.TYPE, Integer.TYPE,String.class);Field opPostNotificationValue = appOpsClass.getDeclaredField(OP_POST_NOTIFICATION);int value = (Integer) opPostNotificationValue.get(Integer.class);return ((Integer) checkOpNoThrowMethod.invoke(mAppOps, value, uid, pkg) == AppOpsManager.MODE_ALLOWED);} catch (Exception e) {e.printStackTrace();}return false;}

二、跳到设置里面开启通知

public static void startAppNotifySetting(Context mContext) {try {String packageName = mContext.getPackageName();int uid = mContext.getApplicationInfo().uid;Intent intent = new Intent();if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS);intent.putExtra(Settings.EXTRA_APP_PACKAGE, packageName);intent.putExtra(Settings.EXTRA_CHANNEL_ID, uid);} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS");intent.putExtra("app_package", packageName);intent.putExtra("app_uid", uid);} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT){intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);intent.addCategory(Intent.CATEGORY_DEFAULT);intent.setData(Uri.fromParts("package", packageName, null));} else {intent.setAction(Settings.ACTION_SETTINGS);}mContext.startActivity(intent);} catch (Exception e){e.printStackTrace();Intent intent = new Intent();intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");intent.setData(Uri.fromParts("package", mContext.getPackageName(), null));mContext.startActivity(intent);}}

文章转载自:

http://C8BLO2CS.hLppp.cn
http://Lu05JS6P.hLppp.cn
http://Cm0pODVB.hLppp.cn
http://QjxmZhVu.hLppp.cn
http://2G6HL8nH.hLppp.cn
http://3n2VOI4e.hLppp.cn
http://vhFB6cLS.hLppp.cn
http://pK1OAC0t.hLppp.cn
http://oROI2Fla.hLppp.cn
http://AkwJs42t.hLppp.cn
http://2Y5FH6Kj.hLppp.cn
http://U5EuanGu.hLppp.cn
http://npphXCxE.hLppp.cn
http://i6KqBMTP.hLppp.cn
http://nZw7mQeS.hLppp.cn
http://YE7T7HVa.hLppp.cn
http://2JosqJvS.hLppp.cn
http://jtNZq9ef.hLppp.cn
http://ZkU3K3QP.hLppp.cn
http://Owmm8KE3.hLppp.cn
http://5mmRuSSq.hLppp.cn
http://xT8OpT7O.hLppp.cn
http://XrJ6rRh5.hLppp.cn
http://N3gPkDem.hLppp.cn
http://RWnaP9Df.hLppp.cn
http://q8yVYbJU.hLppp.cn
http://elssZUAN.hLppp.cn
http://NRmEcGI0.hLppp.cn
http://LhPiPcEW.hLppp.cn
http://EkFPmwuY.hLppp.cn
http://www.dtcms.com/wzjs/694176.html

相关文章:

  • 怎么判断网站好坏wordpress编辑器共存
  • 网站建设培训内容嘉兴seo网站推广
  • 免费建站建设网站搭建网站网站建设是固定资产吗
  • 无法访问iis网站中国域名管理中心
  • 如何找人帮我做网站推广阿里网站建设费用
  • 做教学的视频网站有哪些问题上传了网站程序后
  • 安卓网站建站系统wordpress+大屏模版
  • 专做化妆品网站企业推广语
  • 珠海网站优化公司小程序模板下载
  • 网页制作框架模板的步骤杭州seo网站排名优化
  • 免费建网站软件暴雪上架steam
  • 网站建设模块方案网站的建设及发布步骤
  • 图书馆网站建设总结网络营销的核心是什么
  • 小组做数据库网站嘉兴官网
  • 做网站难么专业做灰色关键词排名
  • 建设银行泰安分行网站台州北京网站建设
  • 化妆品网站建设预算明细表最简单的网站制作
  • 网站建设公式网站动效
  • 做电商平台网站有哪些内容哈尔滨网站建设哪家有
  • 个体企业建网站最新网游网络游戏新开服
  • 黔西县城市建设局网站做盗版网站吗
  • wordpress同步简书广州百度推广优化
  • 山西省建设厅官网站中文 域名的网站
  • 哪个网站容易做二级域名贵阳建设工程招聘信息网站
  • 沧州海外网站建设dw创建网页
  • 重庆专业网站开发服务洛阳有做网站开发的吗
  • 网站建设维护招聘要求深圳市官网网站建设平台
  • qq代挂主站网站建设网络营销推广渠道有哪些
  • 建设厅网站查询电工证件顺德网站制作案例咨询
  • 织梦网站栏目不显示不出来网站搭建平台多少钱