baboncjusz
Lurker
Hey,
I have an application project where BaseActivity.kt is a class inherited by others. I am having trouble implementing Firebase in the PageLoginActivity.kt and PageSignUpActivity.kt classes. Could someone help me? I’ve been working on this for three days, and it’s slowly killing me… Below, I will add piece of the codes.
Thank you in advance.
Regards,
PZ
I have an application project where BaseActivity.kt is a class inherited by others. I am having trouble implementing Firebase in the PageLoginActivity.kt and PageSignUpActivity.kt classes. Could someone help me? I’ve been working on this for three days, and it’s slowly killing me… Below, I will add piece of the codes.
BaseActivity.kt
abstract class BaseActivity(@LayoutRes val layoutId: Int) :
AppCompatActivity(), BaseControllerFunctionsImpl {
lateinit var binding: T
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this@BaseActivity, layoutId) as T
binding.lifecycleOwner = this
addObservers()
setUpClicks()
onInitialized()
}
(…)
PageLoginActivity.kt
class PageLoginActivity : BaseActivity(R.layout.activity_page_login) {
private val viewModel: PageLoginVM by viewModels()
override fun onInitialized(): Unit {
viewModel.navArguments = intent.extras?.getBundle(“bundle”)
binding.pageLoginVM = viewModel
}
(…)
PageSignUpActivity.kt
class PageSignupActivity : BaseActivity(R.layout.activity_page_signup) {
private val viewModel: PageSignupVM by viewModels()
override fun onInitialized() {
viewModel.navArguments = intent.extras?.getBundle(“bundle”)
binding.pageSignupVM = viewModel
}
(…)
Thank you in advance.
Regards,
PZ