{"action":"reopened","issue":{"url":"https://api.github.com/repos/mattlogan/Pancakes/issues/2","labels_url":"https://api.github.com/repos/mattlogan/Pancakes/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/mattlogan/Pancakes/issues/2/comments","events_url":"https://api.github.com/repos/mattlogan/Pancakes/issues/2/events","html_url":"https://github.com/mattlogan/Pancakes/issues/2","id":111446277,"number":2,"title":"Add StackChangedListener","user":{"login":"mattlogan","id":4635072,"avatar_url":"https://avatars.githubusercontent.com/u/4635072?v=3","gravatar_id":"","url":"https://api.github.com/users/mattlogan","html_url":"https://github.com/mattlogan","followers_url":"https://api.github.com/users/mattlogan/followers","following_url":"https://api.github.com/users/mattlogan/following{/other_user}","gists_url":"https://api.github.com/users/mattlogan/gists{/gist_id}","starred_url":"https://api.github.com/users/mattlogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattlogan/subscriptions","organizations_url":"https://api.github.com/users/mattlogan/orgs","repos_url":"https://api.github.com/users/mattlogan/repos","events_url":"https://api.github.com/users/mattlogan/events{/privacy}","received_events_url":"https://api.github.com/users/mattlogan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-14T17:14:44Z","updated_at":"2015-10-15T17:29:12Z","closed_at":null,"body":"This is in response to the previously closed pull request https://github.com/mattlogan/Pancakes/pull/1.\r\n\r\nI think it is useful to have a StackChangedListener so consumers can be notified of changes to the navigation stack. This may useful for situations like updating the host Activity's Toolbar with data provided by a View. For example:\r\n\r\n```java\r\npublic class DogsView implements NamedView {\r\n    // ...\r\n\r\n    @Override\r\n    public String viewName() {\r\n        return \"Dogs\";\r\n    }\r\n}\r\n```\r\n\r\nThen in the host Activity:\r\n\r\n```java\r\npublic class DogActivity extends AppCompatActivity {\r\n    // ...\r\n\r\n    @Override\r\n    public void onStackChanged() {\r\n        NamedView topView = (NamedView) viewStack.peekView();\r\n        toolbar.setTitle(topView.viewName());\r\n    }\r\n}\r\n```"}}