报错:requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
final private int REQUEST_CODE_ASK_PERMISSIONS = 123; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { int hasWriteContactsPermission = checkSelfPermission(Manifest.permission.WRITE_CONTACTS); if(hasWriteContactsPermission != PackageManager.PERMISSION_GRANTED) { requestPermissions(new String[]{Manifest.permission.WRITE_CONTACTS}, REQUEST_CODE_ASK_PERMISSIONS); return; } }