title: Android 11 Capture image using Camera
body: <p>Documentation - <a href="https://developer.android.com/training/camera/photobasics" rel="noreferrer">https://developer.android.com/training/camera/photobasics</a></p>
  <p>I have followed all the required steps to capture image using camera.</p>
  <pre><code>private void dispatchTakePictureIntent() {
      Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
      if (takePictureIntent.resolveActivity(getPackageManager()) != null) { // its always null
          startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
      }
  }
  </code></pre>
  <p><code>takePictureIntent.resolveActivity(getPackageManager())</code> - this line always returns null. and if i skip this check than camera opens but app crashes.</p>