public class UiThreadUtil
extends java.lang.Object
Constructor and Description |
---|
UiThreadUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
assertNotOnUiThread()
Throws an
AssertionException if the current thread is the UI thread. |
static void |
assertOnUiThread()
Throws an
AssertionException if the current thread is not the UI thread. |
static boolean |
isOnUiThread() |
static void |
runOnUiThread(java.lang.Runnable runnable)
Runs the given
Runnable on the UI thread. |
public static boolean isOnUiThread()
true
if the current thread is the UI thread.public static void assertOnUiThread()
AssertionException
if the current thread is not the UI thread.public static void assertNotOnUiThread()
AssertionException
if the current thread is the UI thread.public static void runOnUiThread(java.lang.Runnable runnable)
Runnable
on the UI thread.