# Handle hardware back button

**URL:** <https://forum.ionicframework.com/t/handle-hardware-back-button/48014>\
**Category:** ionic-v1\
**Created:** [March 31, 2016, 3:57pm UTC](https://forum.ionicframework.com/t/handle-hardware-back-button/48014 "2016-03-31T15:57:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabiobalsamo](https://avatars.discourse-cdn.com/v4/letter/f/47e85d/32.png) [@fabiobalsamo](https://forum.ionicframework.com/u/fabiobalsamo)\
**Post date:** [March 31, 2016, 3:57pm UTC](https://forum.ionicframework.com/t/handle-hardware-back-button/48014/1 "2016-03-31T15:57:15Z")

</div>

Hi, how handle hardware back button in one page app? I read about this  
$ionicPlatform.registerBackButtonAction(function(){  
if($ionicHistory.currentStateName === ‘someStateName’){  
event.preventDefault();  
}else{  
$ionicHistory.goBack();  
}  
}, 100);

but i have a file browser app that have just one page with a list of files?  
How can i disable hardware back button at first path of files?
