如何在RoboGuice中为LayoutInflater注入布局?

时间:2015-03-03 14:18:02

标签: android roboguice

我有布局

R.layout.alarm_clock_setting_view

我想将他注入LayoutInflater。

现在我做下一个:

@InjectView(R.layout.alarm_clock_setting_view)
private RelativeLayout alarmClockSettingView;

...
//in OnCreate
 mSettingAlarmClockView = alarmClockSettingView;
...

但那没用。我需要做什么才能将布局注入LayoutInflater?

错误:

 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.samsung.clock/com.samsung.clock.views.ClockFragmentActivity}: java.lang.IllegalStateException: Unable to use annotation database(s)
E/AndroidRuntime( 3754):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2658)
E/AndroidRuntime( 3754):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2725)
E/AndroidRuntime( 3754):    at android.app.ActivityThread.access$900(ActivityThread.java:172)
E/AndroidRuntime( 3754):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
E/AndroidRuntime( 3754):    at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 3754):    at android.os.Looper.loop(Looper.java:145)
E/AndroidRuntime( 3754):    at android.app.ActivityThread.main(ActivityThread.java:5834)
E/AndroidRuntime( 3754):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 3754):    at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 3754):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
E/AndroidRuntime( 3754):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
E/AndroidRuntime( 3754): Caused by: java.lang.IllegalStateException: Unable to use annotation database(s)
E/AndroidRuntime( 3754):    at roboguice.RoboGuice.initializeAnnotationDatabaseFinderAndHierarchyTraversalFilterFactory(RoboGuice.java:292)
E/AndroidRuntime( 3754):    at roboguice.RoboGuice.getOrCreateBaseApplicationInjector(RoboGuice.java:149)
E/AndroidRuntime( 3754):    at roboguice.RoboGuice.getOrCreateBaseApplicationInjector(RoboGuice.java:90)
E/AndroidRuntime( 3754):    at roboguice.RoboGuice.getInjector(RoboGuice.java:197)
E/AndroidRuntime( 3754):    at roboguice.activity.RoboFragmentActivity.onCreate(RoboFragmentActivity.java:60)
E/AndroidRuntime( 3754):    at MainActivity.onCreate(MainActivity.java:95)
E/AndroidRuntime( 3754):    at android.app.Activity.performCreate(Activity.java:6221)
E/AndroidRuntime( 3754):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
E/AndroidRuntime( 3754):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2611)
E/AndroidRuntime( 3754):    ... 10 more

0 个答案:

没有答案