private void Update()
{
if (Application.platform == RuntimePlatform.Android)
{
if (UnityEngine.InputSystem.Keyboard.current.escapeKey.isPressed)
{
OnBackButtonPressed();
}
}
}
This seems to be working