当我使用RoboGuice2.0注入一些模块时,我得到一个像这样的ArrayIndexOutOfBoundsException
Caused by: java.lang.ArrayIndexOutOfBoundsException
at java.util.ArrayList.add(ArrayList.java:129)
at com.google.inject.internal.ap.a(Unknown Source)
at com.google.inject.internal.da.b(Unknown Source)
at com.google.inject.internal.da.a(Unknown Source)
at com.google.inject.internal.da.a(Unknown Source)
at com.google.inject.internal.da.a(Unknown Source)
at com.google.inject.internal.da.a(Unknown Source)
at com.google.inject.internal.bn.a(Unknown Source)
at com.google.inject.internal.InternalInjectorCreator.build(Unknown Source)
at com.google.inject.Guice.createInjector(Unknown Source)
at com.google.inject.Guice.createInjector(Unknown Source)
at roboguice.RoboGuice.setBaseApplicationInjector(Unknown Source)
at com.sankuai.movie.MovieApplication.onCreate(Unknown Source)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:984)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3825)
我像这样使用了setBaseApplicationInjector。
List<Module> modules = new ArrayList<Module>();
modules.add(new DefaultNetModule(Consts.BASE_URL));
modules.add(new DefaultLocationModule(this, false, null, 30000, 5000,
10000));
modules.add(new UpdateDownloadModule(this, "movie",
BaseConfig.sChannel, BaseConfig.sVersionCode,
BaseConfig.sVersionName, null));
modules.add(new MovieModule());
modules.add(new AccountModules(getApplicationContext()));
RoboGuice.setBaseApplicationInjector(this, Stage.DEVELOPMENT, Modules
.override(RoboGuice.newDefaultRoboModule(this)).with(modules));
当我向List添加内容时,它很可能发生在RoboGuice2.0源代码中。但是当使用list.add方法时,似乎无法抛出ArrayIndexOutOfBoundsException。 我想知道我的用法是否正确以及这个问题的解决方案。