Search code examples
androidroboguiceslidingmenu

@ContentView in Sliding Menu activity


I'm trying to inject the contentview after extending SlidingFragmentActivity from sliding menu library. But I'm getting error like

 java.lang.IllegalStateException: Both setBehindContentView must be called in onCreate in addition to setContentView".

But it works fine if i set the content inside onCreate. Can any one suggest solution for this?


Solution

  • You have to call setBehindContentView yourself even when using @ContentView. The @ContentView annotation calls setContentView for you in the onCreate of the super class (RoboActivity), but not setBehindContentView.