Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How do i access close [x] on android?

Discussion in 'Editor & General Support' started by lz7cjc, Mar 3, 2021.

  1. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    534
    Hi
    When I launch my app i get the x for close in the corner. How do i make this active so when it is tapped I can call Application.Quit. I found code for the back button but not the close (x)
    1. if (Application. platform == RuntimePlatform. Android)
    2. {
    3. if (Input. GetKey(KeyCode. Escape))
    4. {
    5. // Insert Code Here (I.E. Load Scene, Etc)
    6. // OR Application. Quit();
    7. return;
    8. }


    thanks