ActivityCompat.requestPermissions(thisActivity,
new String[]{Manifest.permission.READ_CONTACTS},
MY_PERMISSIONS_REQUEST_READ_CONTACTS);
我想逐个添加权限。我有6个许可,需要补助金。我见过很多应用程序,一次有多个权限要求。但我无法做到。它只问了一次。我已经添加了相同的代码5次。
答案 0 :(得分:0)
int MY_PERMISSIONS_REQUEST_READ_CONTACTS=0;
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.READ_CONTACTS,Manifest.permission.ACCESS_COARSE_LOCATION,Manifest.permission.ACCESS_FINE_LOCATION
,Manifest.permission.ACCESS_NETWORK_STATE,Manifest.permission.INTERNET,Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.CAMERA,Manifest.permission.CALL_PHONE},
MY_PERMISSIONS_REQUEST_READ_CONTACTS);