Annotation Type WorkerThread


  • @Documented
    @Retention(RUNTIME)
    @Target({METHOD,CONSTRUCTOR,TYPE,PARAMETER})
    public @interface WorkerThread
    Indicates that the target method will always run on a worker thread, i.e., a thread other than the UI thread. Due to thread safety concerns, methods running on a worker thread should not call UiThread methods. Conversely, UiThread methods should not call WorkerThread methods.

    If the annotated element is a class, then this indicates that all of the methods in the class will be called on a worker thread.

    For methods which may sometimes run on a worker thread and sometimes on the UI thread, please use the AnyThread annotation instead.

    See Also:
    UiThread, AnyThread