You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class MainActivity : AppCompatActivity(), KodeinAware {
override val kodein by kodein()
private val dataHandler: DataHandler by instance()
override fun attachBaseContext(newBase: Context?) {
val appLanguage = dataHandler.getLanguage()
super.attachBaseContext(MyContextWrapper.wrap(newBase,appLanguage ))
}
}
I need to access my SharedPreferences instance in the attachBaseContext of my activity (so I can set the locale there), but the injected SharedPreferences instance is not available there as the injection is happening in the onCreate method, which is running after the attachBaseContext call. I am using kodein , android studio, kotlin.
The text was updated successfully, but these errors were encountered:
class MainActivity : AppCompatActivity(), KodeinAware {
override val kodein by kodein()
private val dataHandler: DataHandler by instance()
}
I need to access my SharedPreferences instance in the attachBaseContext of my activity (so I can set the locale there), but the injected SharedPreferences instance is not available there as the injection is happening in the onCreate method, which is running after the attachBaseContext call. I am using kodein , android studio, kotlin.
The text was updated successfully, but these errors were encountered: