@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_data);
permission();
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
builder.detectFileUriExposure();
}
private void permission() {
if (Build.VERSION.SDK_INT >= 23) {
String[] mPermissionList = new String[]{
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.CALL_PHONE,
Manifest.permission.READ_LOGS,
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.SET_DEBUG_APP,
Manifest.permission.SYSTEM_ALERT_WINDOW,
Manifest.permission.GET_ACCOUNTS,
Manifest.permission.WRITE_APN_SETTINGS,
Manifest.permission.CAMERA};
ActivityCompat.requestPermissions(MyDataActivity.this, mPermissionList, 123);
}
}
8.0相机权限
最新推荐文章于 2021-05-27 04:10:28 发布