Building a Camera App in Mono for Android: Listing 2
Updating OnActivityResult().
- By Greg Shackles
- 08/14/2012
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
if (requestCode == TakePictureRequestCode)
{
var picture = FindViewById<ImageView>(Resource.Id.Picture);
using (var image = MediaStore.Images.Media.GetBitmap(ContentResolver, _pictureFileUri))
{
picture.SetImageBitmap(image);
}
var broadcastIntent = new Intent(Intent.ActionMediaScannerScanFile);
broadcastIntent.SetData(_pictureFileUri);
SendBroadcast(broadcastIntent);
}
}