title: How to check if the device has a flash for front and back facing camera separately?
body: <p>I am currently working on a camera activity. I managed to access my device's back camera flash light and to hide the flash toggle button when I switch to the front camera automatically. However, I was wondering if there was a way to check for secondary flash lights since many smartphone models come with front camera flash light and that would also help when using this application from a tablet without back camera flash light. My idea is checking for the front and back facing camera flash lights separately with two independent booleans and if the flash light is not available, setting the toggle button invisible. I really dislike the idea of showing or hiding the flash button without making sure the device has flash light or not in any of its cameras. This is what I have so far. Any ideas?</p>
  
  <pre><code>private boolean hasFlash(Context Context) {
      if (Context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH)) {
          return true;
      } else {
          return false;
      }
  }
  </code></pre>
  
  <p>_</p>
  
  <pre><code> if (!hasFlash(Context)) {
              ImageButton FlashButton = (ImageButton) findViewById(R.id.frnxcameraflashbutton);
                              FlashButton.setVisibility(View.INVISIBLE);
                              FlashButton.setImageResource(R.mipmap.cameraflashoffbutton);
          }
  </code></pre>