当前位置: 首页>>代码示例>>Java>>正文


Java PermissionGen类代码示例

本文整理汇总了Java中kr.co.namee.permissiongen.PermissionGen的典型用法代码示例。如果您正苦于以下问题:Java PermissionGen类的具体用法?Java PermissionGen怎么用?Java PermissionGen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PermissionGen类属于kr.co.namee.permissiongen包,在下文中一共展示了PermissionGen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initPermission

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
private void initPermission() {
    /*if (ContextCompat.checkSelfPermission(DownLoadActivity.this,
            Manifest.permission.WRITE_EXTERNAL_STORAGE)
            != PackageManager.PERMISSION_GRANTED) {

        ActivityCompat.requestPermissions(DownLoadActivity.this,
                new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
                MY_PERMISSIONS_REQUEST_CALL_PHONE);
    }*/

    PermissionGen.with(DownLoadActivity.this)
            .addRequestCode(100)
            .permissions(
                    Manifest.permission.WRITE_EXTERNAL_STORAGE)
            .request();

    /*PermissionGen.needPermission(DownLoadActivity.this, 100,
            new String[]{
                    Manifest.permission.WRITE_EXTERNAL_STORAGE
            }
    );*/

}
 
开发者ID:Pingsh,项目名称:Mix,代码行数:24,代码来源:DownLoadActivity.java

示例2: onInit

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
@Override
protected void onInit(Bundle savedInstanceState) {
    super.onInit(savedInstanceState);
    fullScreen();
    new Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            PermissionGen.with(SplashActivity.this)
                    .addRequestCode(100)
                    .permissions(
                            Manifest.permission.READ_EXTERNAL_STORAGE,
                            Manifest.permission.WRITE_EXTERNAL_STORAGE
                    )
                    .request();
        }
    }, 2000);

}
 
开发者ID:jiajunhui,项目名称:PlayerBase,代码行数:19,代码来源:SplashActivity.java

示例3: onCreate

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    tv_photo_info = (TextView) findViewById(R.id.tv_photo_info);
    tv_video_info = (TextView) findViewById(R.id.tv_video_info);
    tv_audio_info = (TextView) findViewById(R.id.tv_audio_info);
    tv_file_info = (TextView) findViewById(R.id.tv_file_info);
    tv_traversal_info = (TextView) findViewById(R.id.tv_traversal_info);

    findViewById(R.id.btn_next).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(getApplicationContext(),MainActivity2.class);
            startActivity(intent);
        }
    });

    PermissionGen.with(MainActivity.this)
            .addRequestCode(100)
            .permissions(
                    Manifest.permission.READ_EXTERNAL_STORAGE)
            .request();

}
 
开发者ID:jiajunhui,项目名称:MediaLoader,代码行数:27,代码来源:MainActivity.java

示例4: onCreate

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    tv_photo_info = (TextView) findViewById(R.id.tv_photo_info);
    tv_video_info = (TextView) findViewById(R.id.tv_video_info);
    tv_audio_info = (TextView) findViewById(R.id.tv_audio_info);
    tv_file_info = (TextView) findViewById(R.id.tv_file_info);
    tv_traversal_info = (TextView) findViewById(R.id.tv_traversal_info);

    PermissionGen.with(MainActivity2.this)
            .addRequestCode(100)
            .permissions(
                    Manifest.permission.READ_EXTERNAL_STORAGE)
            .request();

}
 
开发者ID:jiajunhui,项目名称:MediaLoader,代码行数:19,代码来源:MainActivity2.java

示例5: open

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
@OnClick({R.id.btn_contact, R.id.btn_camera})
public void open(View view){
  switch (view.getId()){
    case R.id.btn_contact:
      PermissionGen.with(MainActivity.this)
          .addRequestCode(100)
          .permissions(
              Manifest.permission.READ_CONTACTS,
              Manifest.permission.RECEIVE_SMS,
              Manifest.permission.WRITE_CONTACTS)
          .request();
      break;
    case R.id.btn_camera:
      PermissionGen.needPermission(this, 200, Manifest.permission.CAMERA);
      break;
  }
}
 
开发者ID:lovedise,项目名称:PermissionGen,代码行数:18,代码来源:MainActivity.java

示例6: initPermission

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
private void initPermission() {
    PermissionGen.with(BaseActivity.this)
            .addRequestCode(PERMISSION_WRITE)
            .permissions(
                    Manifest.permission.WRITE_EXTERNAL_STORAGE)
            .request();
    initExtraPermission();
}
 
开发者ID:Pingsh,项目名称:Mix,代码行数:9,代码来源:BaseActivity.java

示例7: onRequestPermissionsResult

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    /*if (requestCode == MY_PERMISSIONS_REQUEST_CALL_PHONE) {
        if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
            Toast.makeText(DownLoadActivity.this, "申请成功", Toast.LENGTH_SHORT).show();
        } else {
            Toast.makeText(DownLoadActivity.this, "权限拒绝", Toast.LENGTH_SHORT).show();
        }
        return;
    }
    super.onRequestPermissionsResult(requestCode, permissions, grantResults);*/
    PermissionGen.onRequestPermissionsResult(this, requestCode, permissions, grantResults);
}
 
开发者ID:Pingsh,项目名称:Mix,代码行数:14,代码来源:DownLoadActivity.java

示例8: onLoadState

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
@Override
public void onLoadState() {
    setPageState(BaseState.LOADING);
    PermissionGen.with(this)
            .addRequestCode(100)
            .permissions(
                    Manifest.permission.READ_EXTERNAL_STORAGE,
                    Manifest.permission.WRITE_EXTERNAL_STORAGE
            )
            .request();
}
 
开发者ID:jiajunhui,项目名称:PlayerBase,代码行数:12,代码来源:LocalVideoListFragment.java

示例9: init

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
@Override
public void init() {
    PermissionGen.with(this)
            .addRequestCode(100)
            .permissions(
                    //电话通讯录
                    Manifest.permission.GET_ACCOUNTS,
                    Manifest.permission.READ_PHONE_STATE,
                    //位置
                    Manifest.permission.ACCESS_FINE_LOCATION,
                    Manifest.permission.ACCESS_COARSE_LOCATION,
                    Manifest.permission.ACCESS_FINE_LOCATION,
                    //相机、麦克风
                    Manifest.permission.RECORD_AUDIO,
                    Manifest.permission.WAKE_LOCK,
                    Manifest.permission.CAMERA,
                    //存储空间
                    Manifest.permission.WRITE_EXTERNAL_STORAGE,
                    Manifest.permission.WRITE_SETTINGS
            )
            .request();
    if (!TextUtils.isEmpty(UserCache.getToken())) {
        Intent intent = new Intent(this, MainActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
        jumpToActivity(intent);
        finish();
    }
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:29,代码来源:SplashActivity.java

示例10: init

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
@Override
public void init() {
    if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED
            || ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED
            || ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED)
        PermissionGen.with(this)
                .addRequestCode(100)
                .permissions(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.RECORD_AUDIO)
                .request();
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:11,代码来源:TakePhotoActivity.java

示例11: openGroupPermission

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
public void openGroupPermission() {
    PermissionGen
            .with(this)
            .addRequestCode(100)
            .permissions(
                    Manifest.permission.READ_EXTERNAL_STORAGE,
                    Manifest.permission.WRITE_EXTERNAL_STORAGE)
            .request();
}
 
开发者ID:why168,项目名称:AndroidHttpUtils,代码行数:10,代码来源:WelcomeActivity.java

示例12: showTakePicture

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
private void showTakePicture() {
    PermissionGen.with(EventContentActivity.this)
            .addRequestCode(SUCCESSCODE)
            .permissions(
                    Manifest.permission.CAMERA,
                    Manifest.permission.WRITE_EXTERNAL_STORAGE,
                    Manifest.permission.READ_EXTERNAL_STORAGE
            )
            .request();
}
 
开发者ID:wendyltan,项目名称:EasyTodo,代码行数:11,代码来源:EventContentActivity.java

示例13: init

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
@Override
public void init() {
    PermissionGen.with(this)
            .addRequestCode(100)
            .permissions(
                    //电话通讯录
                    Manifest.permission.GET_ACCOUNTS,
                    Manifest.permission.READ_PHONE_STATE,
                    //位置
                    Manifest.permission.ACCESS_FINE_LOCATION,
                    Manifest.permission.ACCESS_COARSE_LOCATION,
                    Manifest.permission.ACCESS_FINE_LOCATION,
                    //相机、麦克风
                    Manifest.permission.RECORD_AUDIO,
                    Manifest.permission.WAKE_LOCK,
                    Manifest.permission.CAMERA,
                    //存储空间
                    Manifest.permission.WRITE_EXTERNAL_STORAGE,
                    Manifest.permission.WRITE_SETTINGS
            )
            .request();
    /**
     * 判断缓存是否为空
     */
    if (!TextUtils.isEmpty(UserCache.getToken())) {
        Intent intent = new Intent(this, MainActivity.class);
        //清空栈内所有的activity启动新的activity
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
        jumpToActivity(intent);
        finish();
    }
}
 
开发者ID:lo625090140,项目名称:lqrwechatrongcloud,代码行数:33,代码来源:SplashActivity.java

示例14: openGroup

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
public void openGroup(View view) {
    PermissionGen
            .with(this)
            .addRequestCode(100)
            .permissions(
                    Manifest.permission.READ_CONTACTS,
                    Manifest.permission.RECEIVE_SMS,
                    Manifest.permission.CAMERA,
                    Manifest.permission.WRITE_CONTACTS)
            .request();
}
 
开发者ID:why168,项目名称:AndroidProjects,代码行数:12,代码来源:PermissionGenActivity.java

示例15: onRequestPermissionsResult

import kr.co.namee.permissiongen.PermissionGen; //导入依赖的package包/类
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    PermissionGen.onRequestPermissionsResult(this, requestCode, permissions, grantResults);
}
 
开发者ID:Pingsh,项目名称:Mix,代码行数:5,代码来源:BaseActivity.java


注:本文中的kr.co.namee.permissiongen.PermissionGen类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。