Makes it possible to trigger actions on back button click and optionally prevent the actual back navigation