|
15 | 15 | */ |
16 | 16 | package org.androidannotations.handler; |
17 | 17 |
|
18 | | -import static com.sun.codemodel.JExpr._null; |
19 | | -import static com.sun.codemodel.JExpr.lit; |
20 | | -import static com.sun.codemodel.JMod.FINAL; |
21 | | -import static com.sun.codemodel.JMod.PUBLIC; |
22 | | -import static com.sun.codemodel.JMod.STATIC; |
23 | | - |
24 | | -import java.util.List; |
25 | | - |
26 | | -import javax.annotation.processing.ProcessingEnvironment; |
27 | | -import javax.lang.model.element.Element; |
28 | | -import javax.lang.model.element.ExecutableElement; |
29 | | -import javax.lang.model.element.VariableElement; |
30 | | - |
| 18 | +import com.sun.codemodel.*; |
31 | 19 | import org.androidannotations.annotations.ServiceAction; |
32 | 20 | import org.androidannotations.helper.APTCodeModelHelper; |
33 | 21 | import org.androidannotations.helper.AnnotationHelper; |
|
37 | 25 | import org.androidannotations.model.AnnotationElements; |
38 | 26 | import org.androidannotations.process.IsValid; |
39 | 27 |
|
40 | | -import com.sun.codemodel.JBlock; |
41 | | -import com.sun.codemodel.JClass; |
42 | | -import com.sun.codemodel.JExpr; |
43 | | -import com.sun.codemodel.JExpression; |
44 | | -import com.sun.codemodel.JFieldVar; |
45 | | -import com.sun.codemodel.JInvocation; |
46 | | -import com.sun.codemodel.JMethod; |
47 | | -import com.sun.codemodel.JVar; |
| 28 | +import javax.annotation.processing.ProcessingEnvironment; |
| 29 | +import javax.lang.model.element.Element; |
| 30 | +import javax.lang.model.element.ExecutableElement; |
| 31 | +import javax.lang.model.element.VariableElement; |
| 32 | +import java.util.List; |
| 33 | + |
| 34 | +import static com.sun.codemodel.JExpr._null; |
| 35 | +import static com.sun.codemodel.JExpr.lit; |
| 36 | +import static com.sun.codemodel.JMod.*; |
48 | 37 |
|
49 | 38 | public class ServiceActionHandler extends BaseAnnotationHandler<EIntentServiceHolder> { |
50 | 39 |
|
@@ -138,7 +127,7 @@ private void addActionToIntentBuilder(EIntentServiceHolder holder, ExecutableEle |
138 | 127 | JBlock body = method.body(); |
139 | 128 |
|
140 | 129 | // setAction |
141 | | - body.invoke(holder.getIntentField(), "setAction").arg(actionKeyField); |
| 130 | + body.invoke("action").arg(actionKeyField); |
142 | 131 |
|
143 | 132 | // For each method params, we get put value into extras |
144 | 133 | List<? extends VariableElement> methodParameters = executableElement.getParameters(); |
|
0 commit comments