-
Notifications
You must be signed in to change notification settings - Fork 24
@OnBackground
Arasthel edited this page Aug 21, 2014
·
3 revisions
This annotation will execute the code inside the method on a background 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 a background Thread. Otherwise it won't return anything as it will be executed inside a Thread.
@OnBackground()
public boolean getResult(){...}
// If myVariable declaration is done on a background Thread
boolean myVariable = getResult();