Created
December 31, 2017 06:11
-
-
Save aasumitro/098b326820d5f1cefe3d72bda0995dee to your computer and use it in GitHub Desktop.
Thread
This file contains 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
//Do thread | |
val background = object : Thread() { | |
override fun run() { | |
try { | |
// Thread will sleep for 2 seconds | |
sleep((2 * 1000).toLong()) | |
openMainActivity() | |
finish() | |
} catch (e: Exception) { | |
//Print error in logcat (development requirement) | |
e.printStackTrace() | |
} | |
} | |
} | |
// start thread | |
background.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment