Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Implement Akavache

$
0
0

Hello developers,

I want implement akavache this way:

        public App()
        {
            InitializeComponent();
            BlobCache.ApplicationName = "AkavacheExperiment";
            //MainPage = new Login();
        }

        protected async override void OnStart()
        {
            // Handle when your app starts
            try
            {
                var login = await BlobCache.Secure.GetLoginAsync("login");
                MainPage = new MainPage();
            }
            catch (KeyNotFoundException)
            {
                MainPage = new Login();
            }


        }

And when execute the app, throw this exception and I do not know why.

System.NullReferenceException: Object reference not set to an instance of an object.

How to do it correctly ??

Regards


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>