-
public class UiThreadUtilUtility for interacting with the UI thread.
-
-
Method Summary
Modifier and Type Method Description static booleanisOnUiThread()static voidassertOnUiThread()Throws an AssertionException if the current thread is not the UI thread. static voidassertNotOnUiThread()Throws an AssertionException if the current thread is the UI thread. static voidrunOnUiThread(Runnable runnable)Runs the given {@code Runnable}on the UI thread.static voidrunOnUiThread(Runnable runnable, long delayInMs)Runs the given {@code Runnable}on the UI thread with the specified delay.-
-
Method Detail
-
isOnUiThread
static boolean isOnUiThread()
-
assertOnUiThread
static void assertOnUiThread()
Throws an AssertionException if the current thread is not the UI thread.
-
assertNotOnUiThread
static void assertNotOnUiThread()
Throws an AssertionException if the current thread is the UI thread.
-
runOnUiThread
static void runOnUiThread(Runnable runnable)
Runs the given
{@code Runnable}on the UI thread.
-
runOnUiThread
static void runOnUiThread(Runnable runnable, long delayInMs)
Runs the given
{@code Runnable}on the UI thread with the specified delay.
-
-
-
-