@TargetApi(Build.VERSION_CODES.M) public static void requestMultiplePermissions(Activity activity,String[] permissionsList,int requestCode){
  try {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
      List<String> permissions=new ArrayList<>();
      for (      String permission : permissionsList) {
        if (activity.checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) {
          permissions.add(permission);
        }
      }
      if (!permissions.isEmpty()) {
        activity.requestPermissions(permissions.toArray(new String[permissions.size()]),requestCode);
      }
    }
  }
 catch (  Exception e) {
    logThis(TAG,"requestMultiplePermissions Exception",e);
  }
}

@ TargetApi ( Build . VERSION_CODES . M ) public static void requestMultiplePermissions ( Activity activity , String [ ] permissionsList , int requestCode ) { try { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . M ) { List < String > permissions = new ArrayList < > ( ) ; for ( String permission : permissionsList ) { if ( activity . checkSelfPermission ( permission ) != PackageManager . PERMISSION_GRANTED ) { permissions . add ( permission ) ; } } if ( ! permissions . isEmpty ( ) ) { activity . requestPermissions ( permissions . toArray ( new String [ permissions . size ( ) ] ) , requestCode ) ; } } } catch ( Exception e ) { logThis ( TAG , "requestMultiplePermissions Exception" , e ) ; } }
request multiple permissions ( android m + )
