I'm using libGdx with multiple screens. I want to use the back key on my android device to back to the previous screen similar to how android goes back to the prevvious activity by default.
My current way of doing this is to have every screen get the screen it was called from. Then I'd implement the InputProcessor in every Screen and use it to receive back key presses and then change the screen to the one that was shown before.
While this works, it sucks when working with multiple screens because essentially one has to rewrite the code over and over again.
Does anyone know a more elegant way of achieving this? Does libGdx maybe even have this function by default and I just don't find it? Or do I need to do it this way.
Thanky you for answering,
Cheers,
Tony