Annotation Type AnyThread


  • @Documented
    @Retention(RUNTIME)
    @Target({TYPE,METHOD,CONSTRUCTOR,PARAMETER})
    public @interface AnyThread
    Indicates that the target method may be called on any thread, including the UI thread (by the platform or other IDE components), so should not call any Slow methods. On the other hand they may be called on a non-UI thread so should not call UiThread methods directly either, instead scheduling such code to be executed on the UI thread.

    If the annotated element is a class, then all methods in the class obey the contract described above.

    If the annotated element is a method parameter, e.g. a Runnable, it means the callback may be invoked on any thread and needs to obey hte contract described above.

    See Also:
    UiThread, Slow