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
{{ message }}
This repository was archived by the owner on Dec 10, 2024. It is now read-only.
// 1) Remove userManager field
@Inject
lateinit var userManager: UserManager
@Inject
lateinit var mainViewModel: MainViewModel
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings) <<<<<<<<<<<<< Not Supposed to be here <<<<<<<<<<
// 2) Grab userManager from appComponent to check if the user is logged in or not
val userManager = (application as MyApplication).appComponent.userManager()
if (!userManager.isUserLoggedIn()) { ... }
else {
setContentView(R.layout.activity_main)
// 3) If the MainActivity needs to be displayed, we get the UserComponent
// from the application graph and gets this Activity injected
userManager.userComponent!!.inject(this)
setupViews()
}
}
...