i think, for such actions, it is better to use what the os provides. maybe a hardware button, maybe a software-button, maybe a gesture. we just don’t care, and only listen to the event “user wants to go back”.
one otherwise easily enters areas hard to maintain, eg. android 10 will support swipe-to-go-back by the system - apps that use this gesture on their own would probably need adaption.
of course, this is only a rule of thumb, however, it often turns out in the past, after all experiences, that this is a good way to go, esp. on android, where you have tons of different manufactors with different android flavours.