# Android, fmod core, fmod.jar, AudioDevice.close called twice

**URL:** <https://qa.fmod.com/t/android-fmod-core-fmod-jar-audiodevice-close-called-twice/14997>\
**Category:** FMOD Engine\
**Created:** [August 30, 2019, 1:05pm UTC](https://qa.fmod.com/t/android-fmod-core-fmod-jar-audiodevice-close-called-twice/14997 "2019-08-30T13:05:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeanArthurDeda](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeanarthurdeda/32/647_2.png) [@JeanArthurDeda](https://qa.fmod.com/u/JeanArthurDeda)\
**Post date:** [August 30, 2019, 1:05pm UTC](https://qa.fmod.com/t/android-fmod-core-fmod-jar-audiodevice-close-called-twice/14997/1 "2019-08-30T13:05:00Z")

</div>

Hello,  
I’m using fmod core (not studio) from C++ (JNI) on Android and I’ve noticed that AudioDevice.close (from fmod.jar) is called from FMOD::System::mixerSuspend and from FMOD::System::release.  
In my case, when the activity goes into pause I dispatch a call to mixerSuspend and when it’s destroyed I’m dispatching a call to release. This makes that when leaving the activity for good, AudioDevice.close is called twice (from from onPause-\>…-\>mixerSuspend and then from onDestroy-\>…-\>release) and it seems that the close function is not designed for this particular case (on the second call mTrack is null and I get a crash :)).  
I wonder if anyone has any advice’s on how I can better deal with this situation.  
I still want to to stop the sound processing when the application is paused into background and resume it when the application returns.

Thanks,  
Jean-Arthur Deda.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [September 5, 2019, 11:44pm UTC](https://qa.fmod.com/t/android-fmod-core-fmod-jar-audiodevice-close-called-twice/14997/2 "2019-09-05T23:44:11Z")

</div>

`MixerResume` should also be called from `OnDestroy`, as it is possible to transition from `OnStop` directly to `OnDestroy`. If the system is not suspended then `MixerResume` will not have any effect.

We will also add more on this to our docs to clarify this in the future.
