Created
September 19, 2019 00:30
-
-
Save ininmm/fe36a39e914311f36f671fdf8dc9567e to your computer and use it in GitHub Desktop.
Sample CoroutineScope
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
class MainActivity : AppCompatActivity(), CoroutineScope { | |
override val coroutineContext: CoroutineContext | |
get() = job | |
val job = Job() // 默認使用預設 thread | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment