1

While trying to get my first Xamarin app running I want to save data. This seems to be done e.g. with

Application.Current.Properties["id"] = id;

My problem is that Visual Studio does not "recognize" the Current - and Intellisense does not offer it to me.

I imported

using System;
using Android.App;
using Android.Content;
using Android.Widget;
using Android.OS;

Whole Code in protected override void OnCreate(Bundle bundle):

btnSaveLogin.Click += (object sender, EventArgs e) =>
            {
                Application.Current.Properties["id"] = id;
            };

What Am I missing?

Stefan Meyer
  • 889
  • 1
  • 9
  • 19

1 Answers1

3

Application.Current.Properties applies to Xamarin.Forms, not Xamarin.Android. In Xamarin Android you can achieve a similar result by using SharedPreferences.

Community
  • 1
  • 1
Jason
  • 86,222
  • 15
  • 131
  • 146