How to bind with provider which uses annotation value in Guice?
问题 Is there any way to bind with provider which interprets target's annotation value in Google Guice? Example: bind(Resource.class) .annotatedWith(MyAnnotation.class) .toProvider(new MyProvider<MyAnnotation, Resource>{ public Resource get(MyAnnotation anno){ return resolveResourceByAnnoValue(anno.value()); } }); I want to initialize field of an Android Activity class by annotated binding. It should have to take multiple resources by it's unique Id. Original Way: public class TestActivity extends