Search Unity

Question I creating export from unity for android and Back button is not working in Android-OS-13

Discussion in 'Documentation' started by NkCapermint, Nov 24, 2023.

  1. NkCapermint

    NkCapermint

    Joined:
    Jul 21, 2023
    Posts:
    1
    Hello
    I have issue in Android Back button in device which have android OS13.
    If I create Apk from Unity and test it in Android-OS-13, I can get back button callbacks, but if I export it as Android, and creating apk from android studio, than back button callbacks will not work for Android-OS-13. Here is my code.


    Code (CSharp):
    1. void Update()
    2.     {
    3.  
    4.         if (Input.GetKeyDown(KeyCode.Escape))
    5.         {
    6.             Debug.Log("Escape key was pressed");
    7.         }
    8.  
    9.         if (Input.GetKeyUp(KeyCode.Escape))
    10.         {
    11.             Debug.Log("Escape key was released");
    12.         }
    13.  
    14.         if (Input.GetKey(KeyCode.Escape))
    15.         {
    16.             Debug.Log("Escape key is being pressed");
    17.         }
    18. }