custom renderer not called after updating xamarin?

Hi...
I have a Circle Image that when clicked call an activity on android throught a custom renderer...
It was working fine but now doesnt... it creates the page but dont call the activity

                  public static CircleImage Photo = new CircleImage (); //declaration as global var

            Photo.GestureRecognizers.Add (new TapGestureRecognizer (async sender => {
                profilePhoto.Opacity = 0.6;
                await profilePhoto.FadeTo (1);

                    var pag = new CropperPage();
                    await Navigation.PushAsync(pag);
        }));


public class CropperPage : ContentPage
    {  //class
        public CropperPage ()
        {
                }
       }



    [assembly:ExportRenderer(typeof(App.CropperPage), typeof(App.Droid.CropperPageRenderer))]

    namespace App.Droid
    { //renderer
        [Activity (Label = "CropperPageRenderer")]          
        public class CropperPageRenderer : PageRenderer
        {


            public CropperPageRenderer()
            {           
                Console.WriteLine("*****Droid Crop Page*****");
            }

            private Activity _activity;

            protected override void OnElementChanged(ElementChangedEventArgs<Page> e)
            {
                base.OnElementChanged(e);

                _activity = Context as Activity;

                Intent intent = new Intent(_activity, typeof(App.Droid.CropImageActivity));

                _activity.StartActivityForResult(intent, 0);
            }
        }
    }

Anyway if I put the same command in a button it works!

                         Button button = new Button();

                         button.Clicked += async (sender, e) => {

                var page = new CropperPage();
                Navigation.PushAsync(page);

            };
Tagged:

Posts

Sign In or Register to comment.