forked from GitHub-Mirror/riotX-android
Add basic session management to avoid login each time
This commit is contained in:
@ -23,6 +23,7 @@ class LoginActivity : RiotActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_login)
|
||||
authenticateButton.setOnClickListener { authenticate() }
|
||||
checkActiveSessions()
|
||||
}
|
||||
|
||||
private fun authenticate() {
|
||||
@ -48,6 +49,13 @@ class LoginActivity : RiotActivity() {
|
||||
})
|
||||
}
|
||||
|
||||
private fun checkActiveSessions() {
|
||||
if (authenticator.hasActiveSessions()) {
|
||||
matrix.currentSession = authenticator.getLastActiveSession()
|
||||
goToHomeScreen()
|
||||
}
|
||||
}
|
||||
|
||||
private fun goToHomeScreen() {
|
||||
val intent = HomeActivity.newIntent(this)
|
||||
startActivity(intent)
|
||||
|
Reference in New Issue
Block a user