In the end I was calling the class incorrectly. I was instantiating an instance of the class and not just calling the variable as part of the application level. I'm going to rewrite things to use ViewModels but at this time I'm going to work with this as I need to move forward.
From an Activity I could get and set things with:
(applicationContext as GlobalVars).setSomeVariable(true)
(applicationContext as GlobalVars).getSomeVariable()
From a Fragment
(activity.applicationContext as GlobalVars).setSomeVariable(true)
(activity.applicationContext as GlobalVars).getSomeVariable()
I also rewrote the GlovalVars class to show the getters and setters:
class GlobalVars:Application() {
private var isConnected: Boolean = false
fun getSomeVariable(): Boolean {
return isConnected
}
fun setSomeVariable(someVariable: Boolean) {
this.isConnected = someVariable
}