Created
June 6, 2018 11:13
-
-
Save EmmanuelGuther/04c4fa8acfa8260208e17cd7daafbbb9 to your computer and use it in GitHub Desktop.
A way to close all activities except one. Android Kotlin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun closeActivitiesGoLogin(context: Context?) { | |
val intent = Intent(context, LoginActivity::class.java) | |
val cn = intent.component | |
val mainIntent = Intent.makeRestartActivityTask(cn) | |
context?.startActivity(mainIntent) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment