Use Android hardware back button to go back to previous slide in a slidebox

Hi

I have a slidebox in my app.

<ion-slide-box>...

What is the best practice to make the Android hardware back button go back to the previous slide ?
Without disturbing the general behavior of the back button in the reste of the app…

Thanks

I didn’t put it to the test, but have you tried this ?:

$ionicPlatform.registerBackButtonAction(function(){

$ionicSlideBoxDelegate.previous();

}, 100);

put it in the controller

Great it works, but now, what if I need the back button to have its normal behavior if I am on the first slide ?

Thanks

I tried the solution from @bengtler here : registerBackButtonAction working on many views

but it doesn’t seem to de-register the function…

try this solution: Closing modal With Android back button