protected override void OnActivityResult(int requestCode, Result resultCode, Intent intent)
 {
     base.OnActivityResult(requestCode, resultCode, intent);
     //Facebook
     FacebookClientManager.OnActivityResult(requestCode, resultCode, intent);
     //Google
     GoogleClientManager.OnAuthCompleted(requestCode, resultCode, intent);
 }
        protected override void OnActivityResult(int requestCode, Result resultCode, Intent intent)
        {
            base.OnActivityResult(requestCode, resultCode, intent);
            FacebookClientManager.OnActivityResult(requestCode, resultCode, intent);
            GoogleClientManager.OnAuthCompleted(requestCode, resultCode, intent);

            //If we are calling multiple image selection, enter into here and return photos and their filepaths.
            if (requestCode == OPENGALLERYCODE && resultCode == Result.Ok)
            {
                List <string> images = new List <string>();

                if (intent != null)
                {
                    //Separate all photos and get the path from them all individually.
                    ClipData clipData = intent.ClipData;
                    if (clipData != null)
                    {
                        for (int i = 0; i < clipData.ItemCount; i++)
                        {
                            ClipData.Item   item = clipData.GetItemAt(i);
                            Android.Net.Uri uri  = item.Uri;
                            var             path = GetRealPathFromURI(uri);

                            if (path != null)
                            {
                                images.Add(path);
                            }
                        }
                    }
                    else
                    {
                        Android.Net.Uri uri  = intent.Data;
                        var             path = GetRealPathFromURI(uri);

                        if (path != null)
                        {
                            images.Add(path);
                        }
                    }

                    //Send our images to the carousel view.
                    MessagingCenter.Send <App, List <string> >((App)Xamarin.Forms.Application.Current, "ImagesSelectedAndroid", images);
                }
            }
        }
        protected override void OnActivityResult(int requestCode, Result resultCode, Intent intent)
        {
            base.OnActivityResult(requestCode, resultCode, intent);
            FacebookClientManager.OnActivityResult(requestCode, resultCode, intent);
            GoogleClientManager.OnAuthCompleted(requestCode, resultCode, intent);

            CallbackManager.OnActivityResult(requestCode, (int)resultCode, intent);

            if (requestCode == PickImageId)
            {
                if ((resultCode == Result.Ok) && (intent != null))
                {
                    Android.Net.Uri uri = intent.Data;

                    Stream stream = ContentResolver.OpenInputStream(uri);
                    PickImageTaskCompletionSource.SetResult(stream);
                }
                else
                {
                    PickImageTaskCompletionSource.SetResult(null);
                }
            }
        }
Exemple #4
0
 protected override void OnActivityResult(int requestCode, Result resultCode, Android.Content.Intent data)
 {
     base.OnActivityResult(requestCode, resultCode, data);
     GoogleClientManager.OnAuthCompleted(requestCode, resultCode, data);
 }