私は Android アプリを開発しており、Roboguice 2.0 を使用しています。
今を除いて、すべてが信じられないほどうまくいっています。このようなサービスにカスタム バインディングを挿入しようとしていますが、機能していません。
@Inject
private TicketService ticketService;
@Inject
private PerformanceService performanceService;
これらは次のようにバインドされています (最初はカスタム アプリ コンテキストです)。
RoboGuice.setBaseApplicationInjector(
this,
RoboGuice.DEFAULT_STAGE,
Modules.override(RoboGuice.newDefaultRoboModule(this))
.with(
new KoliseoModule(),
new DatastoreModule(this),
new ServiceModule()
));
public class ServiceModule extends AbstractModule {
@Override
protected void configure() {
bind(JsonCheckinTimestampService.class).to(JsonCheckinTimestampServiceImpl.class);
bind(PerformanceService.class).to(PerformanceServiceImpl.class);
bind(ShowService.class).to(ShowServiceImpl.class);
bind(TicketService.class).to(TicketServiceImpl.class);
bind(ValidationStatisticsService.class).to(ValidationStatisticsServiceImpl.class);
}
}
何か案は?
ありがとう