I am working on an android game, and i find that whenever i call application.quit() my game will crash…
Here is the code
public void Update()
{
if(Input.key(Keycode.Escape)
{
Application.Quit();
}
}
Here is the logcat
DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0)
"main" prio=5 tid=1 TIMED_WAIT
| group="main" sCount=1 dsCount=0 obj=0x41b03728 self=0x41aee600
| sysTid=31780 nice=0 sched=0/0 cgrp=apps handle=1074147324
| state=S schedstat=( 0 0 0 ) utm=118 stm=42 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x41b03b28> (a java.lang.VMThread) held by tid=1 (main)
at java.lang.Thread.parkFor(Thread.java:1205)
at sun.misc.Unsafe.park(Unsafe.java:325)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:199)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1009)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1302)
at java.util.concurrent.Semaphore.tryAcquire(Semaphore.java:382)
at com.unity3d.player.UnityPlayer.pause((null):-1)
at com.unity3d.player.UnityPlayerNativeActivity.onPause((null):-1)
at android.app.Activity.performPause(Activity.java:5235)
at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1233)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3145)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3114)
at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3092)
at android.app.ActivityThread.access$800(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1315)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:5225)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)
I dont understand why this is happening ?