2

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?

Avadhani Y
  • 7,566
  • 19
  • 63
  • 90
Nemo
  • 1,059
  • 3
  • 14
  • 31

2 Answers2

1

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.

Jeroen
  • 3,399
  • 1
  • 22
  • 25
0

Finally i found solution for it

setContentView(R.layout.activity_main);
setBehindContentView(menu);

try this one . Its helpful for me.

Anand Savjani
  • 2,484
  • 3
  • 26
  • 39