[Xamarin - Android]
I have an object (that extends from Android.App.Service) and saves its context into a public static (volatile) variable so that calls across the application can use it as the context for method calls from context [or that requires a context].
However, after about several hours later, it gets collected and start throwing null object reference exception everywhere that calls this variable.
How can I avoid it and is there a better way to do it?
Edit: The purpose for the variable is to make static calls that requires context for some functions like "Toast".