我试图从滑动菜单库中扩展SlidingFragmentActivity
后注入contentview
。但我得到错误像@滑动菜单活动中的@ContentView
java.lang.IllegalStateException: Both setBehindContentView must be called in onCreate in addition to setContentView".
但它工作正常,如果我设置onCreate
内的内容。任何人都可以为此提出解决方案吗?
我试图从滑动菜单库中扩展SlidingFragmentActivity
后注入contentview
。但我得到错误像@滑动菜单活动中的@ContentView
java.lang.IllegalStateException: Both setBehindContentView must be called in onCreate in addition to setContentView".
但它工作正常,如果我设置onCreate
内的内容。任何人都可以为此提出解决方案吗?
即使使用@ContentView
,您也必须自己拨打setBehindContentView
。 @ContentView
注释在超类(RoboActivity)的onCreate
中为您调用setContentView
,但不是setBehindContentView
。
终于让我找到解决方案,这
setContentView(R.layout.activity_main);
setBehindContentView(menu);
试试这个。它对我有帮助。