我正在尝试将用户发送到基于其电子邮件已验证的活动,然后是否具有用户名。到目前为止我的代码看起来像这样:
if (isEmailVerified == true) {
if (user.displayName == null) {
startIntent(NewUserLayoutProfile)
} else {
startIntent(MainActivity)
}
}
if (isEmailVerified == false) {
startIntent(ResendEmailVerification)
}
和
private fun startIntent (theIntent: Activity) {
val i = Intent(this, theIntent::class.java)
startActivity(i)
}
我如何通过活动?我尝试将它作为字符串传递,但是没有用。我在这做错了什么?
这是适用于Kotlin的代码:
if (userInfo?.isEmailVerified == false) {
startIntent(ResendEmailVerification::class.java)
} else {
if (userInfo?.displayName != null) {
startIntent(MainActivity::class.java)
} else {
startIntent(NewUserLayoutProfile::class.java)
}
}
和
private fun startIntent (theIntent: Class<*>) {
val i = Intent(this, theIntent)
startActivity(i)
}