0

I want to display multiple windows in a queue after some wait time. So what is the best way to implement the same?

  1. ThreadPoolExecutor
  2. FutureTask
  3. Coroutines or any other way in Kotlin?
Appcapster
  • 139
  • 1
  • 9

1 Answers1

0

Coroutines would be my first choice.

launch {
    delay(1000)
    displayWindow()
}
Simon
  • 1,657
  • 11
  • 16
  • What if I want to display multiple window? Eg : on one event display window after 10 sec. After 5 sec I trigger another event which displays window after 5 sec. To avoid multiple windows I want a callback. So how can I solve this ? – Appcapster Jun 16 '20 at 10:22
  • To prevent multiple windows, create a singleton helper object for displaying popup window, with a property isShowing (for example) and handle new window displaying only if isShowing is set to false. Just an idea, there are multiple ways to achieve that. – Simon Jun 17 '20 at 05:24