-
public class UiThreadUtil
Utility for interacting with the UI thread.
-
-
Method Summary
Modifier and Type Method Description static boolean
isOnUiThread()
static void
assertOnUiThread()
Throws an AssertionException if the current thread is not the UI thread. static void
assertNotOnUiThread()
Throws an AssertionException if the current thread is the UI thread. static void
runOnUiThread(Runnable runnable)
Runs the given {@code Runnable}
on the UI thread.static void
runOnUiThread(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.
-
-
-
-