title: How to display front camera by default in android studio
body: <p>When clicking on a button I need to open the front camera by default but back camera is displaying. Please give me some idea how to open front camera.</p>
  
  <p>This is my code:</p>
  
  <pre><code>b1.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
              intent.putExtra("android.intent.extras.CAMERA_FACING", 1);
              startActivityForResult(intent, 0);
          }
      }); Bitmap bmp;
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      // TODO Auto-generated method stub
      super.onActivityResult(requestCode, resultCode, data);
  
      if ( data != null &amp;&amp; data.getExtras() !=  null) {
          bmp = (Bitmap) data.getExtras().get("data");
          iv.setImageBitmap(bmp);
      }
  
  }
  </code></pre>