@Retention(value=CLASS)
@Target(value=TYPE)
public @interface RoboGuice
Should be used on Activity classes that use the RoboGuice framework.
Example :
@EActivity(R.layout.main)
@RoboGuice({ AstroListener.class, AnotherListener.class })
public class AstroGirl extends Activity {
@ViewById
EditText edit;
@Inject
GreetingService greetingService;
@Click
void button() {
String name = edit.getText().toString();
greetingService.greet(name);
}
}
public class AstroListener {
@Inject
Context context;
public void doSomethingOnResume(@Observes OnResumeEvent onResume) {
Toast.makeText(context, "Activity has been resumed", Toast.LENGTH_LONG).show();
}
}
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.Class<?>[] |
value
The RoboGuice listener classes to bind to this activity.
|
Copyright © 2010-2014. All Rights Reserved.