Accessing Application.Current.Properties from native Android Xamarin

I have a Xamarin Forms app and I am adding an AppWidget to the Android Native project to give my app a widget which users can pin on their home screen and use to interact. The Xamarin Forms app stores state in

 Application.Current.Properties["MyId"]

How can I access this from the native Android Xamarin code, since Application is in the Xamarin.Forms namespace?

Best Answer

  • TimReganTimRegan US ✭✭
    Accepted Answer
    Xamarin.Forms.Application.Current.Properties["MyId"]
    

    does work in native Android Xamarin!

Answers

  • TimReganTimRegan USMember ✭✭

    (N.B. I have posted this on Stack Overflow here too.)

  • TimReganTimRegan USMember ✭✭
    Accepted Answer
    Xamarin.Forms.Application.Current.Properties["MyId"]
    

    does work in native Android Xamarin!

Sign In or Register to comment.