It appears as if OnActivityResult does not get called after accepting the picture taken from the camera.
Am I calling StartActivityForResult() wrong?, or is there something I am missing.
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Android.OS.Bundle savedInstanceState)
{
var m_View = inflater.Inflate (Resource.Layout.Feed, null);
btnCamera = m_View.FindViewById<Button> (Resource.Id.btnCamera);
btnGallery = m_View.FindViewById<Button> (Resource.Id.btnGallery);
ivPicture = m_View.FindViewById<ImageView> (Resource.Id.imageView1);
btnCamera.Click += (sender, e) => {
//launch gallery
//allow photo editing/saving
var mediaPicker = new MediaPicker (Activity);
if (!mediaPicker.IsCameraAvailable){
// Console.WriteLine ("No Camera!");
}else {
Intent intent = new Intent(MediaStore.ActionImageCapture);
StartActivityForResult(intent, 0);
}
};
btnGallery.Click += (sender, e) => {
//launch gallery
//allow photo editing/saving
var imageIntent = new Intent ();
imageIntent.SetType ("image/*");
imageIntent.SetAction (Intent.ActionGetContent);
StartActivityForResult (
Intent.CreateChooser (imageIntent, "Select photo"), 0);
};
return m_View;
}
protected virtual void OnActivityResult (int requestCode, Result resultCode, Intent data)
{
System.Console.WriteLine ("WOOOOOOOOOOOOOOOOOOOOOOOOOOOO");
Uri contentUri = data.Data;
ivPicture.SetImageURI (data.Data);
}