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

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

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