Hi Xamarin,
I used the following code snippet to learn how to save camera photos to the
SD card.
If I call getThumbailPicture(), both the camera Cancel and Ok buttons calls
OnActivityResult().
But if call saveFullImage(), only the camera Cancel button calls
OnActivityResult().
So, how can I make saveFullImage() calls OnActivityResult()?
Thanks,
King
private void getThumbailPicture()
{
Intent intent = new
Intent(Android.Provider.MediaStore.ActionImageCapture);
StartActivityForResult(intent, TAKE_PICTURE);
}
private void saveFullImage()
{
Intent intent = new
Intent(Android.Provider.MediaStore.ActionImageCapture);
string file =
System.IO.Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath,
"ServiceBook", "images", "test.jpg");
outputFileUri = Android.Net.Uri.Parse(file);
intent.PutExtra(Android.Provider.MediaStore.ExtraOutput,
outputFileUri);
StartActivityForResult(intent, TAKE_PICTURE);
}
protected override void OnActivityResult(int requestCode, Result
resultCode, Intent data)
{
base.OnActivityResult(requestCode, resultCode, data);
if ((requestCode == TAKE_PICTURE) && (resultCode == Result.Ok))
{
// Check if the result includes a thumbnail Bitmap
if (data != null)
{
if (data.HasExtra("data"))
{
var thumbnail =
data.GetParcelableArrayExtra("data");
// TODO Do something with the thumbnail
}
else
{
// TODO Do something with the full image stored
// in outputFileUri
}
}
}
}
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/override-OnActivityResult-not-call-if-a-SD-file-name-is-past-tp5712473.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid