use of org.androidannotations.annotations.SupposeBackground in project androidannotations by androidannotations.
the class SupposeBackgroundHandler method process.
@Override
public void process(Element element, EComponentHolder holder) throws Exception {
ExecutableElement executableElement = (ExecutableElement) element;
JMethod delegatingMethod = codeModelHelper.overrideAnnotatedMethod(executableElement, holder);
AbstractJClass bgExecutor = getJClass(BackgroundExecutor.class);
SupposeBackground annotation = element.getAnnotation(SupposeBackground.class);
String[] serial = annotation.serial();
JInvocation invocation = bgExecutor.staticInvoke(METHOD_CHECK_BG_THREAD);
for (String s : serial) {
invocation.arg(lit(s));
}
JBlock body = delegatingMethod.body();
body.pos(0);
body.add(invocation);
body.pos(body.getContents().size());
}
Aggregations