测试:
private void OnApplicationPause(bool focus)
{
//进入程序状态更改为前台
if (focus)
{
}
else
{
//离开程序进入到后台状态
}
}
正常进:
OnApplicationFocus, isFocus=True
正常退:
OnApplicationQuit
Home出:
OnApplicationPause, isPause=True
OnApplicationFocus, isFocus=False
Home进:
OnApplicationPause, isPause=False
OnApplicationFocus, _isFocus=True
Kill进程:
当前应用双击Home,然后Kill:
OnApplicationQuit (IOS 有回调,android 没回调)
跳出当前应用,然后Kill:
OnApplicationQuit (IOS和Android都没回调)
网友评论