tags: Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Function: return to home interface
/// </summary>
public class My_test10_returnHome : MonoBehaviour
{
void Update()
{
if (Application.platform == RuntimePlatform.Android && (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Home)))
{
//Application.Quit();
OnClick_applicationQuit();
}
}
public void OnClick_applicationQuit()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
}
Override the onAttachedToWindow method in the Activity interface [img]http://dl.iteye.com/upload/attachment/573904/3dbd148c-7ddb-3344-96a8-3b710976169e.jpg[/img]...
Add the following code to the onCreate() method in the program entry interface. ...
Android uses a bit The following code is some of the tips and problems encountered in daily development, I hope to help you: 1.Implement and press again to exit the reminder The first Second...
Reproduced in: https: //www.cnblogs.com/luxiaofeng54/archive/2011/04/20/2022480.html...
Students who have done unity and Android native interaction should know that when we call the Android native activity in unity, press the Home button to return to the desktop, and then re-enter the un...
ONKEYDOWN event and ONBACKPRESSED method ...
In such a situation, when the launch mode of MainActivity is set to singleTask, press the home button on the non-MainActivity interface to return to the desktop. If you click the application icon to o...
Android re-opens the app and enters the main activity after pressing the home button Problem description: When we write an App, there must be such a situation: the user has performed multi-level opera...
Problem Description: 1. When the APP starts page LauncherActivity startup mode is Singletask, jump to other pages secondactivity, at this time, click AppAP again after pressing the HOME button, first ...
** Android distinguish button long press and short press ** Normally long press will always go onkeydown, so it is best to use onkeyup to distinguish when distinguishing; Note event.startTracking(); /...