Android 笔记

  1. 检查权限

    private static boolean isPermissionGranted(String permission)
    {
        Context context = xx.getContext();
        return PackageManager.PERMISSION_GRANTED == context.checkCallingOrSelfPermission(permission);
    }
    private static boolean canAccessWifi()
    {
        return isPermissionGranted(Manifest.permission.ACCESS_WIFI_STATE);
    }
    

你可能感兴趣的:(Android 笔记)