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


#1

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


#2

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

$ionicPlatform.registerBackButtonAction(function(){

$ionicSlideBoxDelegate.previous();

}, 100);

put it in the controller


#3

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


#4

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

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


#5

try this solution: Closing modal With Android back button