{"action":"created","issue":{"url":"https://api.github.com/repos/OneBusAway/onebusaway-android/issues/356","labels_url":"https://api.github.com/repos/OneBusAway/onebusaway-android/issues/356/labels{/name}","comments_url":"https://api.github.com/repos/OneBusAway/onebusaway-android/issues/356/comments","events_url":"https://api.github.com/repos/OneBusAway/onebusaway-android/issues/356/events","html_url":"https://github.com/OneBusAway/onebusaway-android/issues/356","id":116205746,"number":356,"title":"Action Bar menu items for main fragments are occasionally duplicated","user":{"login":"barbeau","id":928045,"avatar_url":"https://avatars.githubusercontent.com/u/928045?v=3","gravatar_id":"","url":"https://api.github.com/users/barbeau","html_url":"https://github.com/barbeau","followers_url":"https://api.github.com/users/barbeau/followers","following_url":"https://api.github.com/users/barbeau/following{/other_user}","gists_url":"https://api.github.com/users/barbeau/gists{/gist_id}","starred_url":"https://api.github.com/users/barbeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbeau/subscriptions","organizations_url":"https://api.github.com/users/barbeau/orgs","repos_url":"https://api.github.com/users/barbeau/repos","events_url":"https://api.github.com/users/barbeau/events{/privacy}","received_events_url":"https://api.github.com/users/barbeau/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OneBusAway/onebusaway-android/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/OneBusAway/onebusaway-android/milestones/1","html_url":"https://github.com/OneBusAway/onebusaway-android/milestones/Public%20v2.0.x%20release","labels_url":"https://api.github.com/repos/OneBusAway/onebusaway-android/milestones/1/labels","id":1322936,"number":1,"title":"Public v2.0.x release","description":"A public release of version v2.0.x, which is currently available to the alpha testers.","creator":{"login":"barbeau","id":928045,"avatar_url":"https://avatars.githubusercontent.com/u/928045?v=3","gravatar_id":"","url":"https://api.github.com/users/barbeau","html_url":"https://github.com/barbeau","followers_url":"https://api.github.com/users/barbeau/followers","following_url":"https://api.github.com/users/barbeau/following{/other_user}","gists_url":"https://api.github.com/users/barbeau/gists{/gist_id}","starred_url":"https://api.github.com/users/barbeau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barbeau/subscriptions","organizations_url":"https://api.github.com/users/barbeau/orgs","repos_url":"https://api.github.com/users/barbeau/repos","events_url":"https://api.github.com/users/barbeau/events{/privacy}","received_events_url":"https://api.github.com/users/barbeau/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":37,"state":"open","created_at":"2015-09-24T21:47:47Z","updated_at":"2015-11-12T21:18:28Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-11-10T21:27:23Z","updated_at":"2015-11-16T07:18:57Z","closed_at":null,"body":"I've noticed that occasionally the Action Bar menu items for the chosen fragment (e.g., \"Starred stops\") can be duplicated in the list (e.g., \"Remove all starred stops\" shows up multiple times).  It seems to happen when returning to the app after its been in the background for a while.\r\n\r\nWe're using the FragmentManager transaction `.show()` and `.hide` to switch between the \"Nearby\", \"Starred Stops\" and \"My reminders\" fragments, instead of `.replace()`.  We aren't using `.replace()` because that causes the loss of state of the \"Nearby\" map (in `BaseMapFragment`).\r\n\r\nTo manage the menu for each fragment (because of the above), we're managing the visibility of the menu items in `HomeActivity.onPrepareOptionsMenu()` by setting a menu group visible or not visible depending on boolean flags, tracked when the user switches fragments.  Something doesn't seem to be tracking right.\r\n\r\nOne note - apparently fragment `.onPause()` events don't fire when using FragmentManager transaction `.hide()`, and fragment `.onResume()` does not fire when using FragmentManager transaction `.show()`.  Instead, the fragment lifecycle is linked directly to the activity (`HomeActivity`), and a separate fragment method `onHiddenChanged(boolean hidden)` is called with `.show()` and `.hide()`.  Not sure if this is related (I discovered this when working on https://github.com/OneBusAway/onebusaway-android/issues/334)."},"comment":{"url":"https://api.github.com/repos/OneBusAway/onebusaway-android/issues/comments/156944363","html_url":"https://github.com/OneBusAway/onebusaway-android/issues/356#issuecomment-156944363","issue_url":"https://api.github.com/repos/OneBusAway/onebusaway-android/issues/356","id":156944363,"user":{"login":"bbodenmiller","id":1192780,"avatar_url":"https://avatars.githubusercontent.com/u/1192780?v=3","gravatar_id":"","url":"https://api.github.com/users/bbodenmiller","html_url":"https://github.com/bbodenmiller","followers_url":"https://api.github.com/users/bbodenmiller/followers","following_url":"https://api.github.com/users/bbodenmiller/following{/other_user}","gists_url":"https://api.github.com/users/bbodenmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/bbodenmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbodenmiller/subscriptions","organizations_url":"https://api.github.com/users/bbodenmiller/orgs","repos_url":"https://api.github.com/users/bbodenmiller/repos","events_url":"https://api.github.com/users/bbodenmiller/events{/privacy}","received_events_url":"https://api.github.com/users/bbodenmiller/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T07:18:57Z","updated_at":"2015-11-16T07:18:57Z","body":"I'm also seeing this. Some screenshots:\r\n\r\n![screenshot_20151115-231654](https://cloud.githubusercontent.com/assets/1192780/11176159/2e68e260-8bef-11e5-9ae6-a860fc600e5a.png)\r\n\r\n![screenshot_20151115-231658](https://cloud.githubusercontent.com/assets/1192780/11176167/3c821fce-8bef-11e5-83bf-9137293436cf.png)\r\n\r\n"}}