When navigating from a Fragment with MenuItems to one without MenuItems, then back to the Fragment with MenuItems the MenuItems do not appear.
This is still happening. I'm seeing it on the Galaxy S running 2.3.7. It's fixed on my ICS device.
Can you provide a super minimal test case in a .zip or the code in a pastebin somewhere? I can debug it very rapidly tomorrow with one.
I uploaded a zip file to Google docs and shared it with you.
I've narrowed the problem to ActionMenuPresenter#updateMenuView(boolean) not being called the second time. Now figuring out why it's not being called is a whole other matter entirely...
If someone smart wants to give this a try, here's the zip: http://dl.dropbox.com/u/6602046/ABS-release4-issue187.zip
Maybe someone like @SimonVT, the miracle worker :) I've tried just about everything I know. It has something to do with repeated invalidation of the options menu not triggering the aforementioned method which would cause the view to update. If you compare all the relevant class files they're virtually identical. I'll keep at it but it's currently escaping me.
From what I gather, dispatchPresenterUpdate(...) in MenuBuilder is supposed to call updateMenuView(...) when we press back. However, mPresenters is ALWAYS empty when that method is called (it's never empty in the native implementation), causing it to return before updateMenuView(...) is ever called.
The first time updateMenuView(...) is called, it's called from getMenuView(...) since mMenuView is null. The next time, it'll return the cached instance of mMenuView.
And that's about as far as I've gotten. Any ideas?
If I move updateMenuView(...) out of the if (mMenuView == null), the action items show up correctly.
Set menu on action bar before dispatching changes. Closes #187.
@christopherperry Fixed! g0g0g0!
hi,i still have this problem on moto with android2.3,the item radomly disappear in the activity which has a viewpager.i use the lastest version
Ljian ... I am with same problem .. did you resolve?