title: Xamarin android - take picture from camera then pass it to other activity
body: <p>I am new to xamarin and I want to take a picture from the camera when I click on a button on my mainactivity and then, once the picture taken, display it in an imageView in an other activity.</p>
  
  <p>Can you help me? </p>
  
  <p>Here's what I have right now :</p>
  
  <p>MainActivity :</p>
  
  <pre><code>costsButton.Click += delegate
  {
      Intent intent = new Intent(MediaStore.ActionImageCapture);
      StartActivityForResult(intent, 0);
  };
  
  protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
  {
      base.OnActivityResult(requestCode, resultCode, data);
      var extra = data.GetByteArrayExtra("data");
      Intent intent = new Intent(this, typeof(AddFrais));
  
      intent.PutExtra("picture", extra);
      StartActivity(intent);
  }
  </code></pre>
  
  <p>AddFrais.cs : </p>
  
  <pre><code>namespace Projet_stage_2017
  {
      [Activity(Label = "AddFrais")]
      public class AddFrais : Activity
      {
          ImageView picturefrais;
  
          protected override void OnCreate(Bundle savedInstanceState)
          {
              base.OnCreate(savedInstanceState);
  
              // Set our view from the "main" layout resource
              SetContentView(Resource.Layout.AddFrais);
              picturefrais = FindViewById&lt;ImageView&gt;(Resource.Id.ImageFrais);
              var image = Intent.GetByteArrayExtra("picture") ?? null;
              Bitmap bitmap = BitmapFactory.DecodeByteArray(image, 0, image.Length);
  
              picturefrais.SetImageBitmap(bitmap);
          }
      }
  }
  </code></pre>
  
  <p>I don't know what to put on the "PutExtra" in the mainActivity to be able to create a bitmap on AddFrais.cs... </p>
  
  <p>Thanks for helping !</p>