Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
H

HeiPermission

> 编程语言
Open source

Hei 一句代码搞定 Android M 动态权限检测。信不信由你,反正我用了。

367 stars0 likes1 views
WebsiteGitHub

About

Hei 一句代码搞定 Android M 动态权限检测。信不信由你,反正我用了。

HeiPermission

Android M 动态权限解决方案,Let You Fly!

Demo_APK下载

动图(相信你会Star的)

使用方式

  1. 导入permlib到Project中,app添加库依赖。(建议拷贝源码,可根据需求定制)

  2. 奇淫技巧:

    checkPermission(CheckPermListener listener, int resString, String... mPerms)
    
        - listener:    权限全部通过接口回调,只检测没有后续行为可 null
        - resString:    权限用途的说明提示(引导用户开启权限)
        - mPerms:    申请的高危权限组(可同时申请多个)
    
  3. 下面列出简单的使用方法

Activity中:

首先需要检测权限的 Activity extends PermissionActivity

checkPermission(new CheckPermListener() {
                @Override
                public void superPermission() {
                   TODO : 需要权限去完成的功能
                }
            },R.string.camera, 
            Manifest.permission.CAMERA,
            Manifest.permission.WRITE_EXTERNAL_STORAGE);

Fragment中:

 首先Fragment依存的 Activity extends PermissionActivit

((PermissionActivity)getActivity()).checkPermission(
	new PermissionActivity.CheckPermListener() {
        @Override
        public void superPermission() {
             TODO : 需要权限去完成的功能
        }
    },R.string.camera, Manifest.permission.CAMERA);

感谢开源库

EasyPermissions

联系作者

邮箱:[email protected] #License

Copyright 2016 forJrking

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言