-
Couldn't load subscription status.
- Fork 561
Closed
Labels
Area: Mono.AndroidIssues with the Android API binding (Mono.Android.dll).Issues with the Android API binding (Mono.Android.dll).
Description
Android application type
Classic Xamarin.Android (MonoAndroid12.0, etc.), Android for .NET (net6.0-android, etc.)
Affected platform version
Android 11
Description
In my xamaring android application using camera capture intent to capture the image and upload it. However the intent is returned as null.
My code is like
///////********** Cameracapture code
Intent camIntent= new Intent(MediaStore.ActionImageCapture);
var file = new File(imageStorageDir + File.Separator + "IMG_" + DateTime.Now.Ticks + ".jpg");
var mPhotoUri = Android.Net.Uri.FromFile(file);
camIntent.PutExtra(MediaStore.ExtraOutput, mPhotoUri);
File imageStorageDir = new File(DownloadDirectory, DOWNLOAD_FOLDER);
StartActivityForResult(camIntent, 0);
////////******** MainActivity
protected override void OnActivityResult(int requestCode, Result resultCode, Intent intent)
{
if (intent != null && intent.DataString != null)
{
// my logic when image captured goes here. But image is not being captured
// Here the intent is always received as null and resultCode as CANCELED
}
}
Steps to Reproduce
- Select camera when prompted from intent
- Capture Image
- Select captured Image
Did you find any workaround?
No as of now.
Relevant log output
No response
Metadata
Metadata
Assignees
Labels
Area: Mono.AndroidIssues with the Android API binding (Mono.Android.dll).Issues with the Android API binding (Mono.Android.dll).