How to use StartActivityForResult in Xamarin forms
<p>my objective is to get image from andriod gallery to my portable library.
so far what I have done is created dependency service in my android project</p>

<pre><code>        [assembly: Xamarin.Forms.Dependency(typeof(DependencyInterfaceInjection))]
        namespace SnaponEquipement.SnapConnect.Droid.DependencyInjection
        {
            class DependencyInterfaceInjection :  IDependencyInterface
            {
                public void GetImageForMSD()
                {
                    var imageIntent = new Intent();
                    imageIntent.SetType("image/*");
                    imageIntent.SetAction(Intent.ActionGetContent);
                    var formsContextActivity = (Activity)Forms.Context;
                    formsContextActivity.StartActivityForResult(Intent.CreateChooser(imageIntent, "Select photo"), 0);
                }
           }
       }
</code></pre>

<p>my question is how can I implement OnActivityResult method in dependency class.</p>

<p>and if its not possible and I have to implement this in mainactivity like</p>

<pre><code> protected async override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
            if (resultCode == Result.Ok)
            {
                var imageData = GetBytes(ContentResolver.OpenInputStream(data.Data));
            }
        }
</code></pre>

<p>then how can i send this image bytes to ContentPage of my portable project from where I have invoked dependency method.</p>

<p>Looking forward for support</p>