Forum Xamarin.Forms

Xamarin.Forms send name of xaml to Xamarin.Android to use in Google Analytics

PedroCarrijo_PedroCarrijo_ USMember, University

Hello , my name is Pedro ..

I need of help ,

I need use GoogleAnalytics in my app , and I'm using with .JAR , in android to initialize GoogleAnalytics need an Activity in parameter, but I'm using Xamarin.Forms , So I'm using XAML not Activity , How get XAML and parse to Activity?

Thank you very much in advance..

Pedro Carrijo


  • HunumanHunuman GBMember ✭✭✭✭


    The Activity is usually defined in MainActivity.cs within your Android plarform project.


  • Amar_BaitAmar_Bait DZMember ✭✭✭✭✭

    or just

    var activity = Xamarin.Forms.Forms.Context as MainActivity;
  • PedroCarrijo_PedroCarrijo_ USMember, University
    edited May 2016


    But , in Google Analytics - > Screens enabled name no is equals in the xaml..

    Example name after ( var activity = Xamarin.Forms.Forms.Context as MainActivity; ) - > md5850f02c2bf6d7120685b2532035c706e.MainActivity

    But the name is MainMenu.xaml

Sign In or Register to comment.