(SOLVED) If I press Android back button after do setRoot() Ionic go to previus page

#1

Hi people!
I have a problem with setRoot() and Android back button.
I have a LoginPage and a CalendarPage. When calendarpage is the rootpage and I do setRoot(‘LoginPage’) and I press Android back button I back to CalendarPage…
Why? When I change the root page, is not the previus page “destroyed”?

I don’t want disable back button but maybe is it the best solution :frowning: ?

Solved: setRoot was in a modal, so I changed to ondissmiss of modal.