Skip to content

Instantly share code, notes, and snippets.

@wajahatkarim3
Created January 31, 2021 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wajahatkarim3/1b4323f67498c7b9faa4c39944d8c2ca to your computer and use it in GitHub Desktop.
Save wajahatkarim3/1b4323f67498c7b9faa4c39944d8c2ca to your computer and use it in GitHub Desktop.
Signup click listener before CometChat
// Signup
bi.btnSignup.setOnClickListener {
// Form Validation
// ..................................
// The random code for dummy signup flow
var isDoctor = bi.radioDoctor.isChecked
if (isDoctor) {
val i = Intent(applicationContext, DoctorMainActivity::class.java)
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(i)
finish()
}
else {
val i = Intent(applicationContext, MainActivity::class.java)
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(i)
finish()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment