Skip to content
Arasthel edited this page Aug 21, 2014 · 6 revisions

This annotation will execute the code inside the method on the UI Thread.

##Important

Methods annotated with this can have a return type, such as boolean, String, etc., but you can only use its result when the calling code is also on the UI Thread. Otherwise it won't return anything as it will be executed inside a Handle on another Thread.

Example

@UIThread()
public boolean getResult(){...}

// If myVariable declaration is done on the UI Thread
boolean myVariable = getResult();