1

Despite Android being a multi-threaded, some API classes impose a strict requirement of having to only run on the UI thread.

For example,

  1. All SpeechRecognizer's methods "must be invoked only from the main application thread."
  2. The Android Developer's Threads section describes components from the android.widget and android.view packages as having to run on the main/UI thread.
  3. According to this SO answer, TextToSpeech constructor also needs to be called from the main/UI thread.
  4. The CountDownTimer must also be created on the UI thread, if its thread does not have a Looper.

Which other classes require their methods runOnUiThread()?

Is there a comprehensive list of such classes in the Android SDK?

WebViewer
  • 761
  • 7
  • 21

0 Answers0