I am writing an Android widget using AppWidgetProvider
. To store some values (f.e. downloaded JSON data) I am using Xamarin.Forms.Application.Current.Properties
.
Unfortunately I am getting a null pointer exception (app crashes) after a while (I guess when the system is killing the application in background).
Because I can't just call LoadApplication(new App())
from my AppWidgetProvider
instance I am wondering what to do to prevent Xamarin.Forms.Application.Current
from being null. Am I doing something wrong here in general? Maybe Xamarin.Forms.Application.Current.Properties
is not meant to be used like this.