title: Can request only one set of permissions at a time. Trying to access my android Camera
body: <p>I'm trying to get access to my camera and what happened is that it does not open the camera and kept says that "Can request only one set of permissions at a time". So anybody can help with this problem?</p>
  
  <p>I got this message on my logcat:</p>
  
  <blockquote>
    <p>I/Timeline: Timeline: Activity_launch_request time:318319760
    intent:Intent { act=android.content.pm.action.REQUEST_PERMISSIONS
    pkg=com.google.android.packageinstaller (has extras) } W/Activity: Can
    request only one set of permissions at a time</p>
  </blockquote>
  
  <p>And here is my code that I've referred for requesting the permission on camera:</p>
  
  <pre><code>private static final String[] PERMISSIONS = {
              Manifest.permission.CAMERA
      };
  
      private static final int REQUEST_PERMISSIONS = 42;
      private static final int PERMISSION_COUNT = 1;    
  @SuppressLint("NewApi")
      private boolean arePermissionDenied(){
          for(int i = 0; i&lt;PERMISSION_COUNT;i++){
              if(checkSelfPermission(PERMISSIONS[i])!= PackageManager.PERMISSION_GRANTED){
                  return true;
              }
          }
          return false;
      }
  
      @SuppressLint("NewApi")
      @Override
      public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults){
          super.onRequestPermissionsResult(requestCode,permissions,grantResults);
  
          if(requestCode==REQUEST_PERMISSIONS &amp;&amp; grantResults.length &gt; 0){
              if(arePermissionDenied()){
                  ((ActivityManager)(this.getSystemService(ACTIVITY_SERVICE))).clearApplicationUserData();
                  recreate();
              }
              else{
                  onResume();
              }
          }
          else{
  
          }
      }
  
      //Variable onResume method
      private boolean isCameraInitialized;
      private Camera mCamera = null;
      private static SurfaceHolder myHolder;
      private static CameraPreview mPreview;
      private static OrientationEventListener orientationEventListener = null;
  
      @Override
      protected void onResume(){
          super.onResume();
          if(Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M){
              requestPermissions(PERMISSIONS,REQUEST_PERMISSIONS);
              return;
          }
  
          if(!isCameraInitialized){
              mCamera=Camera.open();
              mPreview = new CameraPreview(this,mCamera);
              frameLayout.addView(mPreview);
              rotateCamera();
              orientationEventListener = new OrientationEventListener(this) {
                  @Override
                  public void onOrientationChanged(int orientation) {
                      rotateCamera();
                  }
              };
              orientationEventListener.enable();
          }
      }
  </code></pre>