org.solovyev.android
Class Threads
java.lang.Object
org.solovyev.android.Threads
public final class Threads
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tryRunOnUiThread
public static void tryRunOnUiThread(@Nullable
android.app.Activity activity,
@Nonnull
Runnable runnable)
- Method tries to run runnable on UI thread. Run can be failed if:
1. Specified activity is null
2. Specified activity is finishing
- Parameters:
activity - activity bound to runnablerunnable - runnable to bve executed
tryRunOnUiThread
public static void tryRunOnUiThread(@Nonnull
Fragment fragment,
@Nonnull
Runnable runnable)
isUiThread
public static boolean isUiThread()
- Returns:
- true if current thread is UI thread (= main application thread)
newUiHandler
@Nonnull
public static android.os.Handler newUiHandler()
- Returns:
- new instance of
Handler which runs on UI thread
Copyright © 2014 se.solovyev. All Rights Reserved.