@Retention(value=CLASS)
@Target(value=METHOD)
public @interface ServiceAction
Should be used on a method that must respond to a specific action in an
EIntentService annotated class. The method name will be used as
action name unless the value() field is set.
The method signature (ie with attributes) will be a part of the IntentBuilder
generated for the EIntentService.
The method could contain any type or parameters.
The class MAY contain several ServiceAction annotated methods.
Example :
@EActivity(R.layout.main)
public class MyActivity extends Activity {
public void launchAction() {
// Note the use of generated class instead of original one
MyIntentService_.intent(this)
.<b>myAction</b>("test", 10L)
.start();
}
}
@EIntentService
public class MyIntentService extends IntentService {
@ServiceAction
void mySimpleAction() {
// ...
}
@ServiceAction
void <b>myAction</b>(String valueString, long valueLong) {
// ...
}
}
EIntentService| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.String |
value
Define the action's name.
|
Copyright © 2010-2014. All Rights Reserved.