Keep SlidingMenu opened after orientation changes
Hi,
I have a MainActivity which extends SlidingFragmentActivity. I cant succeed in keeping the menu opened after an orientation change.
I have seen two methods in SlidingMenu which could be interesting for my problem :
- onSaveInstanceState
- onRestoreInstanceState
but never called :(
many thanks anyway for the library
flavien
I'm hitting this problem too and it's also present in the sample app. It doesn't appear to be straight-forward to store whether the menu is open by using onSaveInstanceState in my activity as showAbove() is called in the GlobalLayoutListener defined in SlidingMenu.
you can open the menu by yourself on the onResume / onStart function with
if(!getSlidingMenu().isMenuShowing()) {
getSlidingMenu().toggle();
}
this will toggle the menu if it is not shown.
In the latest version of the code it will keep track of this. Just pull the code and use the Sliding*Activities
How is this done without using the Sliding*Activity?
I'm currently using onSaveInstanceState and onRestoreInstanceState to keep track of whether it's open or not which isn't ideal.
[edit] I see it's done as above. I.e. there's no support for this without using the base activities. Ho hum.