public final class AsyncHelper
extends java.lang.Object
Constructor and Description |
---|
AsyncHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
assertMainThread()
Ensures that the caller is running on the main thread
|
static void |
assertNotMainThread()
Ensures that the caller is not running on the main thread
|
static boolean |
isMainThread()
Is the calling code running on the main (UI) thread or a background (worker) thread?
|
public static boolean isMainThread()
true
if the calling code is running on the main thread; false
otherwise.public static void assertNotMainThread()
java.lang.IllegalStateException
- if the caller is running on the main threadpublic static void assertMainThread()
java.lang.IllegalStateException
- if the caller is not running on the main thread