title: Multiple Runtime Permissions - Only Requesting First One
body: <p>I am trying to request multiple permissions at the start of my application, but only one of the permissions is being asked and then the screen freezes up. I am attempting to ask for: <code>READ_EXTERNAL_STORAGE</code>, <code>WRITE_EXTERNAL_STORAGE</code>, <code>CAMERA</code>, and <code>BODY_SENSORS</code>. </p>
  
  <p>The thing that baffles me is that I started this application only asking for read and write permissions, and it would ask for them and that's that, the rest of the app would run smoothly, but after adding these other two the app would freeze. </p>
  
  <p>Side note: It is kind of annoying but the way I do permissions is I ask for them right away, so it is still a white screen when the app opens and the permissions popup comes up. After accepting read/write permissions the app freezes and stays on this white screen. Also, I most definitely also added the permissions into my manifest.</p>
  
  <p>I am going to include what one of my permission calls looks like, because all the rest are practically the same, just changing which permission is needed. Below I am including what my <code>CAMERA</code> looks like: </p>
  
  <pre><code>    int permissionCheck3 = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
  
      if(permissionCheck3 != PackageManager.PERMISSION_GRANTED){
          if(ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA)){
              showExplanation("Permission Needed", "Rationale", Manifest.permission.CAMERA, REQUEST_PERMISSION_CAMERA);
          } else {
              ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, REQUEST_PERMISSION_CAMERA);
          }
      }
  
      while(permissionCheck3 != PackageManager.PERMISSION_GRANTED){
          permissionCheck3 = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
      }
  </code></pre>
  
  <p>I use the code above at the very start of my application in my onCreate right after I assign TextViews, Buttons and other things like that. </p>
  
  <pre><code>private void showPhoneStatePermissionCAMERA(boolean displayToast){
      int permissionCheckCAMERA = ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA);
      if(permissionCheckCAMERA != PackageManager.PERMISSION_GRANTED) {
          if(ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA)) {
              showExplanation("Permission Needed", "Rationale", Manifest.permission.CAMERA, REQUEST_PERMISSION_CAMERA);
          } else {
              requestPermission(Manifest.permission.CAMERA, REQUEST_PERMISSION_CAMERA);
          }
      } else {
          if(displayToast){
              Toast.makeText(SignIn.this, "CAMERA Permission (already) Granted!", Toast.LENGTH_SHORT).show();
          }
      }
  }
  </code></pre>
  
  <p>SOME MORE INFO HERE: I have been testing it some more and some interesting things are happening: When I first enter the app, it requests the first permission and then freezes. If I exit the app and re-open it, it requests the second permissions and then freezes, and so on until all the permissions are accepted or denied, then goes on with the application. </p>
  
  <p>Maybe unrelated, but I keep on getting <code>java.util.zip.ZipException: File too short to be a zip file: 0</code> one or two times when I hit run before the app starts. </p>
  
  <p>Any help would be appreciated</p>