# Prevent hardware back button click when loading controller is showing

**URL:** <https://forum.ionicframework.com/t/prevent-hardware-back-button-click-when-loading-controller-is-showing/94607>\
**Category:** ionic-v3\
**Created:** [June 16, 2017, 7:32am UTC](https://forum.ionicframework.com/t/prevent-hardware-back-button-click-when-loading-controller-is-showing/94607 "2017-06-16T07:32:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nsvivek121](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@nsvivek121](https://forum.ionicframework.com/u/nsvivek121)\
**Post date:** [June 16, 2017, 7:32am UTC](https://forum.ionicframework.com/t/prevent-hardware-back-button-click-when-loading-controller-is-showing/94607/1 "2017-06-16T07:32:21Z")

</div>

Hi,

I am using a loading controller during a http call. In android when I press hardware back button the page navigates back but loading controller is still displayed. What I want to disable hardware back button when loading controller is displaying.

Ionic info;  
Cordova CLI: 6.5.0  
Ionic Framework Version: 3.0.1  
Ionic CLI Version: 2.2.2  
Ionic App Lib Version: 2.2.1  
Ionic App Scripts Version: 1.3.0  
ios-deploy version: Not installed  
ios-sim version: Not installed  
OS: macOS Sierra  
Node Version: v6.10.2  
Xcode version: Xcode 8.3.1 Build version 8E1000a

---

<div class="post-metadata">

**Author:** ![Muaaz](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Muaaz](https://forum.ionicframework.com/u/Muaaz)\
**Post date:** [October 4, 2017, 4:01pm UTC](https://forum.ionicframework.com/t/prevent-hardware-back-button-click-when-loading-controller-is-showing/94607/2 "2017-10-04T16:01:26Z")

</div>

i have the same issue let me know when you find the solution. thanks 🙂

---

<div class="post-metadata">

**Author:** ![nsvivek121](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@nsvivek121](https://forum.ionicframework.com/u/nsvivek121)\
**Post date:** [October 5, 2017, 5:55am UTC](https://forum.ionicframework.com/t/prevent-hardware-back-button-click-when-loading-controller-is-showing/94607/3 "2017-10-05T05:55:40Z")

</div>

Not a good solution but I register back button action before calling any http call using registerBackButtonAction function & deregister it in http response or error.

```auto
registerBackButtonAction(){
    this.unregBackCall = this.platform.registerBackButtonAction(() => {

    }, 100);
  }

  removebackbtnaction(){
    this.unregBackCall && this.unregBackCall();
  }

```

Ionic team should add disabling back button action while loading controller is showing.

Thanks
