# Side Menu Android Hardware Back Button

**URL:** <https://forum.ionicframework.com/t/side-menu-android-hardware-back-button/2640>\
**Category:** ionic-v1\
**Created:** [April 4, 2014, 6:19am UTC](https://forum.ionicframework.com/t/side-menu-android-hardware-back-button/2640 "2014-04-04T06:19:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ross](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ross/32/7233_2.png) [@Ross](https://forum.ionicframework.com/u/Ross)\
**Post date:** [April 4, 2014, 6:19am UTC](https://forum.ionicframework.com/t/side-menu-android-hardware-back-button/2640/1 "2014-04-04T06:19:32Z")

</div>

I have a minor issue on Android with the hardware back button on my app’s initial view while the side menu is open. I can get the side menu to close if you hit the back button while it is open but my app also exists after it closes. Is there a way to prevent this? Here is a snippet of what I’m trying to do that almost works -

```
.controller('Home', function($scope, $ionicSideMenuDelegate, $ionicPlatform) {
    $ionicPlatform.onHardwareBackButton(function() {
        if ($ionicSideMenuDelegate.isOpenLeft()) {
            $ionicSideMenuDelegate.toggleLeft();
        }
    });    
});

```

I have tried `return false` and `preventDefault()` in the back button event… no luck though, my app still exits after the side menu closes :~(

Thank you for all the amazing work on Ionic.

---

<div class="post-metadata">

**Author:** ![Ross](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ross/32/7233_2.png) [@Ross](https://forum.ionicframework.com/u/Ross)\
**Post date:** [May 2, 2014, 6:32pm UTC](https://forum.ionicframework.com/t/side-menu-android-hardware-back-button/2640/2 "2014-05-02T18:32:59Z")

</div>

How about making the side menu close on Android when the hardware back button is pressed? Most native Android app’s do this when a side menu is open.

This would be similar to this feature below that was added in beta 1.0.0-beta.3

> **$ionicPopup:** on android, make back button close popup ([b87bcb30](https://github.com/driftyco/ionic/commit/b87bcb30c33fb577b41139c43089b2a864211d56), closes [#1222](https://github.com/driftyco/ionic/issues/1222))

Once again thanks for all the work on Ionic.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [May 2, 2014, 7:37pm UTC](https://forum.ionicframework.com/t/side-menu-android-hardware-back-button/2640/3 "2014-05-02T19:37:25Z")

</div>

If you want, you can make and issue/feature request for this. Sounds like a good feature to have.

---

<div class="post-metadata">

**Author:** ![Ross](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ross/32/7233_2.png) [@Ross](https://forum.ionicframework.com/u/Ross)\
**Post date:** [May 2, 2014, 11:40pm UTC](https://forum.ionicframework.com/t/side-menu-android-hardware-back-button/2640/4 "2014-05-02T23:40:18Z")

</div>

Thank you. I added a [feature request](https://github.com/driftyco/ionic/issues/1264) to the repo.
