我有一个成功创建Notification的NotificationManager Notification notification = new Notification(R.drawable.snog_icon, getString(R.string.sn_g_entering_beacon_mode_),
// The PendingIntent to launch our activity if the user sel
我希望强制使用权限和“快速失败”--一些旧的API悄悄地失败了IIRC --所以我想出了如下建议: final int checkPermission = ctx.getPackageManager().checkPermission( if (checkPermission != PackageManager.PERMISSION_GRANTED) {
thr
.getSystemService(Context.WIFI_SERVICE);}
这抛出了Caused by: java.lang.SecurityException: WifiService: Neither user 10032 nor current process has android.permission.ACCESS_WIFI_STATE.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getSt