Skip to content

Instantly share code, notes, and snippets.

@devrath
Created October 9, 2021 17:42
Show Gist options
  • Select an option

  • Save devrath/ff5e5cec6624e33f73a03fd22ed3d693 to your computer and use it in GitHub Desktop.

Select an option

Save devrath/ff5e5cec6624e33f73a03fd22ed3d693 to your computer and use it in GitHub Desktop.
class SuspendingFuncActivity : BaseActivity() {
override fun getToolbarTitle() = "Suspending Functions"
private lateinit var binding: ActivitySuspendingFuncBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivitySuspendingFuncBinding.inflate(layoutInflater)
setContentView(binding.root)
hideUpButton()
setOnClickListeners()
}
private fun setOnClickListeners() {
binding.apply {
btnLaunchId.setOnClickListener {
simpleDemo()
}
}
}
private fun simpleDemo() {
lifecycleScope.launch {
LegacyCallbackSampleTwo(this.coroutineContext).initiateDemo()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment