动态申请权限

2018年06月03日 199点热度 0人点赞 0条评论
private static String[] PERMISSION_AUDIO = {
        android.Manifest.permission.RECORD_AUDIO,
        android.Manifest.permission.WRITE_EXTERNAL_STORAGE,
        android.Manifest.permission.READ_EXTERNAL_STORAGE
};
int permission = android.support.v4.app.ActivityCompat.checkSelfPermission(MainActivity.this, android.Manifest.permission.RECORD_AUDIO);
if (permission != android.content.pm.PackageManager.PERMISSION_GRANTED) {
    android.support.v4.app.ActivityCompat.requestPermissions(MainActivity.this, PERMISSION_AUDIO, 1);
}

likole

一个后端小白

文章评论