{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic/issues/4916","repository_url":"https://api.github.com/repos/driftyco/ionic","labels_url":"https://api.github.com/repos/driftyco/ionic/issues/4916/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic/issues/4916/comments","events_url":"https://api.github.com/repos/driftyco/ionic/issues/4916/events","html_url":"https://github.com/driftyco/ionic/issues/4916","id":125219957,"number":4916,"title":"bug: $ionicPlatform.onHardwareBackButton() on Android back button not working","user":{"login":"Mathius17","id":6528566,"avatar_url":"https://avatars.githubusercontent.com/u/6528566?v=3","gravatar_id":"","url":"https://api.github.com/users/Mathius17","html_url":"https://github.com/Mathius17","followers_url":"https://api.github.com/users/Mathius17/followers","following_url":"https://api.github.com/users/Mathius17/following{/other_user}","gists_url":"https://api.github.com/users/Mathius17/gists{/gist_id}","starred_url":"https://api.github.com/users/Mathius17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mathius17/subscriptions","organizations_url":"https://api.github.com/users/Mathius17/orgs","repos_url":"https://api.github.com/users/Mathius17/repos","events_url":"https://api.github.com/users/Mathius17/events{/privacy}","received_events_url":"https://api.github.com/users/Mathius17/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-06T17:08:54Z","updated_at":"2016-05-12T07:35:20Z","closed_at":"2016-01-19T22:56:50Z","body":"According to the documentation (http://ionicframework.com/docs/api/controller/ionicModal/), the default behaviour is to close the current modal on back button. But it's not closing anything, instead, it performs the action of the main view, go back.\r\n\r\n>{boolean=} hardwareBackButtonClose: Whether the modal can be closed using the hardware back button on Android and similar devices. Default: true.\r\n\r\nHere is my code when I initialize the modal:\r\n \r\n\r\n    $ionicModal.fromTemplateUrl('app/components/contacts/views/contacts.selectModal.html', {\r\n        scope: $scope,\r\n        animation: 'slide-in-up',\r\n        hardwareBackButtonClose: true\r\n    }).then(function(modal) {\r\n        $scope.contactSelect = modal;\r\n    });\r\n\r\nI'm using Android 5.1, Ionic 1.2.1 and 1.2.4 on physical device, not Ionic View"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic/issues/comments/218681982","html_url":"https://github.com/driftyco/ionic/issues/4916#issuecomment-218681982","issue_url":"https://api.github.com/repos/driftyco/ionic/issues/4916","id":218681982,"user":{"login":"GitGump","id":4926050,"avatar_url":"https://avatars.githubusercontent.com/u/4926050?v=3","gravatar_id":"","url":"https://api.github.com/users/GitGump","html_url":"https://github.com/GitGump","followers_url":"https://api.github.com/users/GitGump/followers","following_url":"https://api.github.com/users/GitGump/following{/other_user}","gists_url":"https://api.github.com/users/GitGump/gists{/gist_id}","starred_url":"https://api.github.com/users/GitGump/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitGump/subscriptions","organizations_url":"https://api.github.com/users/GitGump/orgs","repos_url":"https://api.github.com/users/GitGump/repos","events_url":"https://api.github.com/users/GitGump/events{/privacy}","received_events_url":"https://api.github.com/users/GitGump/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T07:35:20Z","updated_at":"2016-05-12T07:35:20Z","body":"Forgotten to add '$ionicPlatform' dependency is the thing, now it works for me. \r\n\r\nBut I got another problem here,  ``` unregisterBackButtonAction() ``` seems cannot remove the action well, when you leave current view and go to any other view, the Action you attached on hardware button is always on!"}}