本文整理汇总了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
}
);*/
}
示例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);
}
示例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();
}
示例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();
}
示例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;
}
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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);
}