I made a very very simple project to confirm this.
When I call Application.Quit(); the android activities time out.
My device is a “Acer A500 Tablet” - 1GB Ram, Dual-Core Tegra2, Android 4.0.1.
Test Code:
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKeyUp(KeyCode.Escape)) Application.Quit();
}
}
Logcat - EDIT: I was getting timeout errors that would just keep the device black that I forgot to put in the log. You have to wait a few seconds before it prints them after the whole system lags out.
W/InputManagerService( 145): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@415a6c58 (uid=10092 pid=4754)
I/ActivityManager( 145): No longer want com.acer.app (pid 4540): hidden #16
V/Sensors ( 145): set fifo rate: 13 66667000
I/ ( 145): mpu3050_suspend: suspending sensors to 0000
I/ ( 145): mpu3050_suspend: Will resume next to 0070
I/MPL-ml ( 145): Actual ODR: 25 Hz
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeVideoFrameCallback:VILII
I/ ( 145): mpu3050_resume: Resuming to 0070
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSoftInputClosed:V
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetTouchDeltaY:VF
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetInputString:VL
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetInputCanceled:VZ
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetExtras:VL
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetDefaultDisplay:VI
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeResume:V
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeResize:VIIII
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeRequestedAA:I
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeRequested32bitDisplayBuffer:Z
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeRender:Z
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeRecreateGfxState:VL
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativePause:Z
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeKeysPressed:VL
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeInjectEvent:ZL
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeInitWWW:VL
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeFocusChanged:VZ
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeFile:VL
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeDone:V
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeActivityIndicatorStyle:I
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.initJni:VL
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.UnitySendMessage:VLLL
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetLocationStatus:VI
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetLocation:VFFFFDF
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeForwardEventsToDalvik:VZ
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeDeviceOrientation:VI
D/dalvikvm( 4754): Unregistering JNI method Lorg/fmod/FMODAudioDevice;.fmodUnblockStreaming:I
D/dalvikvm( 4754): Unregistering JNI method Lorg/fmod/FMODAudioDevice;.fmodProcess:IL
D/dalvikvm( 4754): Unregistering JNI method Lorg/fmod/FMODAudioDevice;.fmodInitJni:I
D/dalvikvm( 4754): Unregistering JNI method Lorg/fmod/FMODAudioDevice;.fmodGetInfo:II
D/dalvikvm( 4754): Unregistering JNI method Lorg/fmod/FMODAudioDevice;.fmodBlockStreaming:I
D/dalvikvm( 4754): Unregistering JNI method Lorg/fmod/FMODAudioDevice;.fmodProcessMicData:ILI
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/ReflectionHelper;.nativeProxyInvoke:LILL
D/dalvikvm( 4754): Unregistering JNI method Lcom/unity3d/player/ReflectionHelper;.nativeProxyFinalize:VI
I/Process ( 4754): Sending signal. PID: 4754 SIG: 9
I/ActivityManager( 145): Process com.test.test (pid 4754) has died.
I/WindowManager( 145): WIN DEATH: Window{4178c828 com.test.test/com.unity3d.player.UnityPlayerNativeActivity paused=false}
V/NvAudioALSA( 84): Closing ALSA device!, curDev 0x2, curMode 0
D/dalvikvm( 2726): GC_CONCURRENT freed 479K, 7% free 7476K/8007K, paused 2ms+4ms
D/Finsky ( 2726): [1] 5.onFinished: Installation state replication succeeded.
W/ActivityManager( 145): Activity destroy timeout for ActivityRecord{41758548 com.test.test/com.unity3d.player.UnityPlayerNativeActivity}
Same thing for my DroidX phone.
Android 2.3.4.
Logcat:
02-25 03:50:57.811 1324 1335 I ActivityManager: No longer want com.google.android.apps.uploader (pid 2173): hidden #21
02-25 03:50:58.202 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeVideoFrameCallback:VILII
02-25 03:50:58.202 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSoftInputClosed:V
02-25 03:50:58.202 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetTouchDeltaY:VF
02-25 03:50:58.202 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetInputString:VL
02-25 03:50:58.202 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetInputCanceled:VZ
02-25 03:50:58.202 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetExtras:VL
02-25 03:50:58.209 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetDefaultDisplay:VI
02-25 03:50:58.209 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeResume:V
02-25 03:50:58.209 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeResize:VIIII
02-25 03:50:58.209 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeRequestedAA:I
02-25 03:50:58.209 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeRequested32bitDisplayBuffer:Z
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeRender:Z
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeRecreateGfxState:VL
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativePause:Z
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeKeysPressed:VL
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeInjectEvent:ZL
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeInitWWW:VL
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeFocusChanged:VZ
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeFile:VL
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeDone:V
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeActivityIndicatorStyle:I
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.initJni:VL
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.UnitySendMessage:VLLL
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetLocationStatus:VI
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeSetLocation:VFFFFDF
02-25 03:50:58.217 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeForwardEventsToDalvik:VZ
02-25 03:50:58.225 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeDeviceOrientation:VI
02-25 03:50:58.225 2436 2436 D dalvikvm: Unregistering JNI method Lorg/fmod/FMODAudioDevice;.fmodUnblockStreaming:I
02-25 03:50:58.225 2436 2436 D dalvikvm: Unregistering JNI method Lorg/fmod/FMODAudioDevice;.fmodProcess:IL
02-25 03:50:58.225 2436 2436 D dalvikvm: Unregistering JNI method Lorg/fmod/FMODAudioDevice;.fmodInitJni:I
02-25 03:50:58.225 2436 2436 D dalvikvm: Unregistering JNI method Lorg/fmod/FMODAudioDevice;.fmodGetInfo:II
02-25 03:50:58.225 2436 2436 D dalvikvm: Unregistering JNI method Lorg/fmod/FMODAudioDevice;.fmodBlockStreaming:I
02-25 03:50:58.225 2436 2436 D dalvikvm: Unregistering JNI method Lorg/fmod/FMODAudioDevice;.fmodProcessMicData:ILI
02-25 03:50:58.225 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/ReflectionHelper;.nativeProxyInvoke:LILL
02-25 03:50:58.225 2436 2436 D dalvikvm: Unregistering JNI method Lcom/unity3d/player/ReflectionHelper;.nativeProxyFinalize:VI
02-25 03:50:58.249 1324 1331 W GraphicBufferAllocator: free(…) failed -14 (Bad address)
02-25 03:50:58.256 2436 2436 I Process : Sending signal. PID: 2436 SIG: 9
02-25 03:50:58.272 1324 1477 I ActivityManager: Process com.test.test (pid 2436) has died.
02-25 03:50:58.272 1324 1477 I WindowManager: WIN DEATH: Window{40aeb620 com.test.test/com.unity3d.player.UnityPlayerNativeActivity paused=false}
02-25 03:51:00.235 1223 1321 D AudioHardwareMot: AudioStreamOutMot::standby called
02-25 03:51:00.235 1223 1321 D AudioHardwareMot: Output 0x134a0 entering standby
02-25 03:51:00.235 1223 1321 D AudioHardwareMot: Closing Output device
02-25 03:51:01.040 1387 1387 W SharedBufferStack: waitForCondition(LockCondition) timed out (identity=2, status=0). CPU may be pegged. trying again.
02-25 03:51:02.041 1387 1387 W SharedBufferStack: waitForCondition(LockCondition) timed out (identity=2, status=0). CPU may be pegged. trying again.
I’m having the same Issue, but when I press back button while loading something like with “LoadLevel” or “Resoures.Load”. When the game it’s loading (freezed while loading) and I press back button, the game crashes and exits.
Anyone knows something?
I’ve posted this also at http://forum.unity3d.com/threads/179785-Android-back-button-crash-in-first-scene?p=1540927&viewfull=1#post1540927
I pretty sure I did a test on Unity 4.2.2 and this issue did not exist. I think this is a 4.3+ but bug.
NOTE I messed up in my post and didn’t post the FULL LOG. I was getting time out errors after hitting the back button, not “com.unity3d.player.UnityPlayerNativeActivity paused=false” as thats normal behavior.
You have turned on option Developer options → Do not keep activities. Just turn it off and everything will be fine.
How do you get to this file menu option?
It’s in the Settings App of Samsung Devices under More > Developer options > Apps (scroll down) > Do not keep activities