you shud not call finish() in onPause. it could be called for variety of reasons(check doc.). why you want to kill your activity when user switches app? its not recommended. here are some posts, but there is no api available to detect app going in background.
How to detect when an Android app goes to the background and come back to the foreground