Running app is pause when new app is start in android
===

I have develop a audio recorder which is working successfully in background as well as foreground.But there is a problem when i am running my app in background & start another app so both app is running & also some time the new app is not running, so  i want to that if another app is running so my app is go to the pause state & when the current app is finished so my app will resume. How it is possible. Thanks in advance.