Forum Xamarin.Android

How to get current Activity to call StartActivityForResult()

RogerSchmidlinRogerSchmidlin CHUniversity ✭✭✭
edited November 2015 in Xamarin.Android

I would like to call the camera app with the StartActivityForResult() intent. It looks like that this is part of the Activity. How do I get the current Activity? Obviously Android.App.Activity only provides me with the static method. Here my code:

`

        //create new Intent
        Intent recordingIntent = new Intent(MediaStore.ActionVideoCapture);
        recordingIntent.PutExtra(MediaStore.ExtraOutput, Android.OS.Environment.ExternalStorageDirectory.AbsolutePath);  // set the image file name
        recordingIntent.PutExtra(MediaStore.ExtraVideoQuality, 1); // set the video image quality to high

        // start the Video Capture Intent
        StartActivityForResult(recordingIntent, CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE);           

`

Best Answer

Answers

Sign In or Register to comment.